-
+
diff --git a/liferay-workspace/apps/control-panel-portlet/build.gradle b/liferay-workspace/apps/control-panel-portlet/build.gradle
index 75749424e..22bf1c317 100644
--- a/liferay-workspace/apps/control-panel-portlet/build.gradle
+++ b/liferay-workspace/apps/control-panel-portlet/build.gradle
@@ -1,9 +1,9 @@
dependencies {
- compileOnly group: "com.liferay", name: "com.liferay.application.list.api", version: "4.0.2"
- compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "4.4.0"
- compileOnly group: "com.liferay.portal", name: "com.liferay.util.bridges", version: "6.0.2"
- compileOnly group: "com.liferay.portal", name: "com.liferay.util.taglib", version: "4.0.8"
- compileOnly group: "javax.portlet", name: "portlet-api", version: "3.0.0"
- compileOnly group: "javax.servlet", name: "javax.servlet-api", version: "3.0.1"
- compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations", version: "1.3.0"
+ compileOnly group: "com.liferay", name: "com.liferay.application.list.api"
+ compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel"
+ compileOnly group: "com.liferay.portal", name: "com.liferay.util.bridges"
+ compileOnly group: "com.liferay.portal", name: "com.liferay.util.taglib"
+ compileOnly group: "javax.portlet", name: "portlet-api"
+ compileOnly group: "javax.servlet", name: "javax.servlet-api"
+ compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations"
}
\ No newline at end of file
diff --git a/liferay-workspace/apps/ds-portlet/build.gradle b/liferay-workspace/apps/ds-portlet/build.gradle
index 8f4c68f1f..eb4a86057 100644
--- a/liferay-workspace/apps/ds-portlet/build.gradle
+++ b/liferay-workspace/apps/ds-portlet/build.gradle
@@ -1,5 +1,5 @@
dependencies {
- compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "4.4.0"
- compileOnly group: "javax.portlet", name: "portlet-api", version: "3.0.0"
- compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations", version: "1.3.0"
+ compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel"
+ compileOnly group: "javax.portlet", name: "portlet-api"
+ compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations"
}
\ No newline at end of file
diff --git a/liferay-workspace/apps/filter-portlet/build.gradle b/liferay-workspace/apps/filter-portlet/build.gradle
index 8f4c68f1f..eb4a86057 100644
--- a/liferay-workspace/apps/filter-portlet/build.gradle
+++ b/liferay-workspace/apps/filter-portlet/build.gradle
@@ -1,5 +1,5 @@
dependencies {
- compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "4.4.0"
- compileOnly group: "javax.portlet", name: "portlet-api", version: "3.0.0"
- compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations", version: "1.3.0"
+ compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel"
+ compileOnly group: "javax.portlet", name: "portlet-api"
+ compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations"
}
\ No newline at end of file
diff --git a/liferay-workspace/apps/freemarker-portlet/build.gradle b/liferay-workspace/apps/freemarker-portlet/build.gradle
index 831f5af2b..6941850b3 100644
--- a/liferay-workspace/apps/freemarker-portlet/build.gradle
+++ b/liferay-workspace/apps/freemarker-portlet/build.gradle
@@ -1,7 +1,7 @@
dependencies {
- compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "4.4.0"
- compileOnly group: "com.liferay.portal", name: "com.liferay.util.bridges", version: "6.0.2"
- compileOnly group: "com.liferay.portal", name: "com.liferay.util.taglib", version: "4.0.8"
- compileOnly group: "javax.portlet", name: "portlet-api", version: "3.0.0"
- compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations", version: "1.3.0"
+ compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel"
+ compileOnly group: "com.liferay.portal", name: "com.liferay.util.bridges"
+ compileOnly group: "com.liferay.portal", name: "com.liferay.util.taglib"
+ compileOnly group: "javax.portlet", name: "portlet-api"
+ compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations"
}
\ No newline at end of file
diff --git a/liferay-workspace/apps/freemarker-portlet/src/main/resources/templates/init.ftl b/liferay-workspace/apps/freemarker-portlet/src/main/resources/templates/init.ftl
index eea68b181..bfd7f6b7a 100644
--- a/liferay-workspace/apps/freemarker-portlet/src/main/resources/templates/init.ftl
+++ b/liferay-workspace/apps/freemarker-portlet/src/main/resources/templates/init.ftl
@@ -16,13 +16,15 @@
*/
-->
-<#assign aui = PortletJspTagLibs["/META-INF/liferay-aui.tld"] />
-<#assign liferay_portlet = PortletJspTagLibs["/META-INF/liferay-portlet-ext.tld"] />
-<#assign liferay_security = PortletJspTagLibs["/META-INF/liferay-security.tld"] />
-<#assign liferay_theme = PortletJspTagLibs["/META-INF/liferay-theme.tld"] />
-<#assign liferay_ui = PortletJspTagLibs["/META-INF/liferay-ui.tld"] />
-<#assign liferay_util = PortletJspTagLibs["/META-INF/liferay-util.tld"] />
-<#assign portlet = PortletJspTagLibs["/META-INF/liferay-portlet.tld"] />
+<#assign
+ aui = PortletJspTagLibs["/META-INF/liferay-aui.tld"]
+ liferay_portlet = PortletJspTagLibs["/META-INF/liferay-portlet-ext.tld"]
+ liferay_security = PortletJspTagLibs["/META-INF/liferay-security.tld"]
+ liferay_theme = PortletJspTagLibs["/META-INF/liferay-theme.tld"]
+ liferay_ui = PortletJspTagLibs["/META-INF/liferay-ui.tld"]
+ liferay_util = PortletJspTagLibs["/META-INF/liferay-util.tld"]
+ portlet = PortletJspTagLibs["/META-INF/liferay-portlet.tld"]
+/>
<@liferay_theme["defineObjects"] />
<@portlet["defineObjects"] />
\ No newline at end of file
diff --git a/liferay-workspace/apps/greedy-policy-option-portlet/higher-ranked-service/build.gradle b/liferay-workspace/apps/greedy-policy-option-portlet/higher-ranked-service/build.gradle
index cd164330c..038a29f5f 100644
--- a/liferay-workspace/apps/greedy-policy-option-portlet/higher-ranked-service/build.gradle
+++ b/liferay-workspace/apps/greedy-policy-option-portlet/higher-ranked-service/build.gradle
@@ -1,5 +1,5 @@
dependencies {
- compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "4.4.0"
- compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations", version: "1.3.0"
+ compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel"
+ compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations"
compileOnly project(":apps:greedy-policy-option-portlet:service-reference")
}
\ No newline at end of file
diff --git a/liferay-workspace/apps/greedy-policy-option-portlet/service-reference/build.gradle b/liferay-workspace/apps/greedy-policy-option-portlet/service-reference/build.gradle
index 35a3bd71d..b18d06e98 100644
--- a/liferay-workspace/apps/greedy-policy-option-portlet/service-reference/build.gradle
+++ b/liferay-workspace/apps/greedy-policy-option-portlet/service-reference/build.gradle
@@ -1,8 +1,8 @@
dependencies {
- compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "4.4.0"
- compileOnly group: "com.liferay.portal", name: "com.liferay.util.taglib", version: "4.0.8"
- compileOnly group: "javax.portlet", name: "portlet-api", version: "3.0.0"
- compileOnly group: "javax.servlet", name: "javax.servlet-api", version: "3.0.1"
- compileOnly group: "jstl", name: "jstl", version: "1.2"
- compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations", version: "1.3.0"
+ compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel"
+ compileOnly group: "com.liferay.portal", name: "com.liferay.util.taglib"
+ compileOnly group: "javax.portlet", name: "portlet-api"
+ compileOnly group: "javax.servlet", name: "javax.servlet-api"
+ compileOnly group: "jstl", name: "jstl"
+ compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations"
}
\ No newline at end of file
diff --git a/liferay-workspace/apps/hello-soy-portlet/build.gradle b/liferay-workspace/apps/hello-soy-portlet/build.gradle
index 52b830e58..d4aaec4d5 100644
--- a/liferay-workspace/apps/hello-soy-portlet/build.gradle
+++ b/liferay-workspace/apps/hello-soy-portlet/build.gradle
@@ -1,8 +1,8 @@
dependencies {
- compileOnly group: "com.liferay", name: "com.liferay.portal.portlet.bridge.soy.api", version: "1.0.0"
- compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "4.4.0"
- compileOnly group: "com.liferay.portal", name: "com.liferay.util.java", version: "3.0.0"
- compileOnly group: "javax.portlet", name: "portlet-api", version: "3.0.0"
- compileOnly group: "javax.servlet", name: "javax.servlet-api", version: "3.0.1"
- compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations", version: "1.3.0"
+ compileOnly group: "com.liferay", name: "com.liferay.portal.portlet.bridge.soy.api"
+ compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel"
+ compileOnly group: "com.liferay.portal", name: "com.liferay.util.java"
+ compileOnly group: "javax.portlet", name: "portlet-api"
+ compileOnly group: "javax.servlet", name: "javax.servlet-api"
+ compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations"
}
\ No newline at end of file
diff --git a/liferay-workspace/apps/jsp-portlet/build.gradle b/liferay-workspace/apps/jsp-portlet/build.gradle
index cfc869c4e..fbfc0d39f 100644
--- a/liferay-workspace/apps/jsp-portlet/build.gradle
+++ b/liferay-workspace/apps/jsp-portlet/build.gradle
@@ -1,6 +1,6 @@
dependencies {
- compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "4.4.0"
- compileOnly group: "com.liferay.portal", name: "com.liferay.util.taglib", version: "4.0.8"
- compileOnly group: "javax.portlet", name: "portlet-api", version: "3.0.0"
- compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations", version: "1.3.0"
+ compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel"
+ compileOnly group: "com.liferay.portal", name: "com.liferay.util.taglib"
+ compileOnly group: "javax.portlet", name: "portlet-api"
+ compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations"
}
\ No newline at end of file
diff --git a/liferay-workspace/apps/kotlin-portlet/README.markdown b/liferay-workspace/apps/kotlin-portlet/README.markdown
deleted file mode 100644
index 39b35435c..000000000
--- a/liferay-workspace/apps/kotlin-portlet/README.markdown
+++ /dev/null
@@ -1,8 +0,0 @@
-# Kotlin Portlet
-
-This sample highlights the use of the [Kotlin](https://kotlinlang.org/)
-programming language in conjunction with the Liferay MVC framework.
-
-For more details on this sample, see the
-[Kotlin Portlet](https://portal.liferay.dev/docs/7-2/reference/-/knowledge_base/r/kotlin-portlet)
-article on Liferay's Developer Network.
\ No newline at end of file
diff --git a/liferay-workspace/apps/kotlin-portlet/bnd.bnd b/liferay-workspace/apps/kotlin-portlet/bnd.bnd
deleted file mode 100644
index c24192b2b..000000000
--- a/liferay-workspace/apps/kotlin-portlet/bnd.bnd
+++ /dev/null
@@ -1,8 +0,0 @@
-Bundle-SymbolicName: com.liferay.blade.kotlin.portlet
-Bundle-Version: 1.0.0
-Import-Package:\
- !kotlin.*,\
- \
- *
--conditionalpackage: kotlin.*
--sources: true
\ No newline at end of file
diff --git a/liferay-workspace/apps/kotlin-portlet/build.gradle b/liferay-workspace/apps/kotlin-portlet/build.gradle
deleted file mode 100644
index 8c408a91a..000000000
--- a/liferay-workspace/apps/kotlin-portlet/build.gradle
+++ /dev/null
@@ -1,8 +0,0 @@
-dependencies {
- compileOnly group: "com.liferay", name: "com.liferay.petra.lang", version: "3.0.0"
- compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "4.4.0"
- compileOnly group: "com.liferay.portal", name: "com.liferay.util.taglib", version: "4.0.8"
- compileOnly group: "javax.portlet", name: "portlet-api", version: "3.0.0"
- compileOnly group: "org.jetbrains.kotlin", name: "kotlin-osgi-bundle", version: "1.1.2"
- compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations", version: "1.3.0"
-}
\ No newline at end of file
diff --git a/liferay-workspace/apps/kotlin-portlet/src/main/kotlin/com/liferay/blade/samples/portlet/kotlin/KotlinGreeterActionCommand.kt b/liferay-workspace/apps/kotlin-portlet/src/main/kotlin/com/liferay/blade/samples/portlet/kotlin/KotlinGreeterActionCommand.kt
deleted file mode 100644
index 2076fcdb5..000000000
--- a/liferay-workspace/apps/kotlin-portlet/src/main/kotlin/com/liferay/blade/samples/portlet/kotlin/KotlinGreeterActionCommand.kt
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * Copyright 2000-present Liferay, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.liferay.blade.samples.portlet.kotlin
-
-import com.liferay.blade.samples.portlet.kotlin.constants.KotlinGreeterPortletKeys
-import com.liferay.portal.kernel.log.LogFactoryUtil
-import com.liferay.portal.kernel.portlet.bridges.mvc.MVCActionCommand
-import com.liferay.portal.kernel.servlet.SessionMessages
-import com.liferay.portal.kernel.util.ParamUtil
-import com.liferay.portal.kernel.util.StringPool
-
-import javax.portlet.ActionRequest
-import javax.portlet.ActionResponse
-import javax.portlet.PortletException
-
-import org.osgi.service.component.annotations.Component
-
-/**
- * @author Liferay
- */
-@Component(
- immediate = true,
- property = arrayOf(
- "javax.portlet.name=" + KotlinGreeterPortletKeys.KotlinGreeterPortlet,
- "mvc.command.name=greet"
- ),
- service = arrayOf(MVCActionCommand::class)
-)
-class KotlinGreeterActionCommand : MVCActionCommand {
-
- @Throws(PortletException::class)
- override fun processAction(
- actionRequest: ActionRequest?, actionResponse: ActionResponse?): Boolean {
-
- _handleActionCommand(actionRequest)
-
- return true
- }
-
- private fun _handleActionCommand(actionRequest: ActionRequest?) {
- val name = ParamUtil.get(actionRequest, "name", StringPool.BLANK)
-
- if (_log.isInfoEnabled()) {
- _log.info("Hello " + name)
- }
-
- val greetingMessage = "Hello $name!"
-
- actionRequest?.setAttribute("GREETER_MESSAGE", greetingMessage)
-
- SessionMessages.add(actionRequest, "greetingMessage", greetingMessage)
- }
-
- companion object {
- private val _log = LogFactoryUtil.getLog(
- KotlinGreeterActionCommand::class.java)
- }
-
-}
\ No newline at end of file
diff --git a/liferay-workspace/apps/kotlin-portlet/src/main/kotlin/com/liferay/blade/samples/portlet/kotlin/KotlinGreeterPortlet.kt b/liferay-workspace/apps/kotlin-portlet/src/main/kotlin/com/liferay/blade/samples/portlet/kotlin/KotlinGreeterPortlet.kt
deleted file mode 100644
index 29528e100..000000000
--- a/liferay-workspace/apps/kotlin-portlet/src/main/kotlin/com/liferay/blade/samples/portlet/kotlin/KotlinGreeterPortlet.kt
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
- * Copyright 2000-present Liferay, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.liferay.blade.samples.portlet.kotlin
-
-import com.liferay.blade.samples.portlet.kotlin.constants.KotlinGreeterPortletKeys
-import com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet
-
-import java.io.IOException
-
-import javax.portlet.Portlet
-import javax.portlet.PortletException
-import javax.portlet.RenderRequest
-import javax.portlet.RenderResponse
-
-import org.osgi.service.component.annotations.Component
-
-/**
- * @author Liferay
- */
-@Component(
- immediate = true,
- property = arrayOf(
- "com.liferay.portlet.css-class-wrapper=portlet-greeter",
- "com.liferay.portlet.display-category=category.sample",
- "com.liferay.portlet.instanceable=true",
- "javax.portlet.display-name=Kotlin Greeter Portlet",
- "javax.portlet.init-param.template-path=/",
- "javax.portlet.init-param.view-template=/view.jsp",
- "javax.portlet.name=" + KotlinGreeterPortletKeys.KotlinGreeterPortlet,
- "javax.portlet.security-role-ref=power-user,user"
- ),
- service = arrayOf(Portlet::class)
-)
-class KotlinGreeterPortlet : MVCPortlet() {
-
- @Throws(IOException::class, PortletException::class)
- override fun doView(
- renderRequest: RenderRequest, renderResponse: RenderResponse) {
-
- val greeting: String? = renderRequest.getAttribute(KotlinGreeterPortletKeys.GreeterMessage) as String?
-
- if (greeting == null) {
- renderRequest.setAttribute(KotlinGreeterPortletKeys.GreeterMessage, "")
- }
-
- super.doView(renderRequest, renderResponse)
- }
-
-}
\ No newline at end of file
diff --git a/liferay-workspace/apps/kotlin-portlet/src/main/resources/content/Language.properties b/liferay-workspace/apps/kotlin-portlet/src/main/resources/content/Language.properties
deleted file mode 100644
index cd1a164f5..000000000
--- a/liferay-workspace/apps/kotlin-portlet/src/main/resources/content/Language.properties
+++ /dev/null
@@ -1 +0,0 @@
-blade_portlet_kotlinactioncommand_KotlinGreeterPortlet.caption=Welcome to the OSGi Kotlin Portlet!
\ No newline at end of file
diff --git a/liferay-workspace/apps/osgi-portlet/build.gradle b/liferay-workspace/apps/osgi-portlet/build.gradle
index 3d4c2cdf4..00ce46543 100644
--- a/liferay-workspace/apps/osgi-portlet/build.gradle
+++ b/liferay-workspace/apps/osgi-portlet/build.gradle
@@ -1,5 +1,5 @@
dependencies {
- compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "4.4.0"
- compileOnly group: "javax.portlet", name: "portlet-api", version: "3.0.0"
- compileOnly group: "org.osgi", name: "org.osgi.core", version: "6.0.0"
+ compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel"
+ compileOnly group: "javax.portlet", name: "portlet-api"
+ compileOnly group: "org.osgi", name: "org.osgi.core"
}
\ No newline at end of file
diff --git a/liferay-workspace/apps/render-command-portlet/build.gradle b/liferay-workspace/apps/render-command-portlet/build.gradle
index 38bfef494..914eb3a22 100644
--- a/liferay-workspace/apps/render-command-portlet/build.gradle
+++ b/liferay-workspace/apps/render-command-portlet/build.gradle
@@ -1,7 +1,7 @@
dependencies {
- compileOnly group: "com.liferay", name: "com.liferay.petra.lang", version: "3.0.0"
- compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "4.4.0"
- compileOnly group: "com.liferay.portal", name: "com.liferay.util.taglib", version: "4.0.8"
- compileOnly group: "javax.portlet", name: "portlet-api", version: "3.0.0"
- compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations", version: "1.3.0"
+ compileOnly group: "com.liferay", name: "com.liferay.petra.lang"
+ compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel"
+ compileOnly group: "com.liferay.portal", name: "com.liferay.util.taglib"
+ compileOnly group: "javax.portlet", name: "portlet-api"
+ compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations"
}
\ No newline at end of file
diff --git a/liferay-workspace/apps/resource-command-portlet/build.gradle b/liferay-workspace/apps/resource-command-portlet/build.gradle
index e9e31562e..ac9ad4bea 100644
--- a/liferay-workspace/apps/resource-command-portlet/build.gradle
+++ b/liferay-workspace/apps/resource-command-portlet/build.gradle
@@ -1,11 +1,11 @@
dependencies {
- compileOnly group: "com.liferay", name: "com.liferay.captcha.api", version: "1.1.0"
- compileOnly group: "com.liferay", name: "com.liferay.captcha.taglib", version: "2.0.0"
- compileOnly group: "com.liferay", name: "com.liferay.petra.lang", version: "3.0.0"
- compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "4.4.0"
- compileOnly group: "com.liferay.portal", name: "com.liferay.util.taglib", version: "4.0.8"
- compileOnly group: "javax.portlet", name: "portlet-api", version: "3.0.0"
- compileOnly group: "javax.servlet", name: "javax.servlet-api", version: "3.0.1"
- compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations", version: "1.3.0"
- compileOnly group: "org.osgi", name: "osgi.core", version: "6.0.0"
+ compileOnly group: "com.liferay", name: "com.liferay.captcha.api"
+ compileOnly group: "com.liferay", name: "com.liferay.captcha.taglib"
+ compileOnly group: "com.liferay", name: "com.liferay.petra.lang"
+ compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel"
+ compileOnly group: "com.liferay.portal", name: "com.liferay.util.taglib"
+ compileOnly group: "javax.portlet", name: "portlet-api"
+ compileOnly group: "javax.servlet", name: "javax.servlet-api"
+ compileOnly group: "org.osgi", name: "org.osgi.core"
+ compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations"
}
\ No newline at end of file
diff --git a/liferay-workspace/apps/rest/build.gradle b/liferay-workspace/apps/rest/build.gradle
index c911d572e..731ed58ef 100644
--- a/liferay-workspace/apps/rest/build.gradle
+++ b/liferay-workspace/apps/rest/build.gradle
@@ -1,7 +1,7 @@
dependencies {
- compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "4.4.0"
- compileOnly group: "javax.ws.rs", name: "javax.ws.rs-api", version: "2.0.1"
- compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations", version: "1.3.0"
- compileOnly group: "org.osgi", name: "org.osgi.service.jaxrs", version: "1.0.0"
+ compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel"
+ compileOnly group: "javax.ws.rs", name: "javax.ws.rs-api"
+ compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations"
+ compileOnly group: "org.osgi", name: "org.osgi.service.jaxrs"
compileOnly group: "org.osgi", name: "org.osgi.service.log", version: "1.3.0"
}
\ No newline at end of file
diff --git a/liferay-workspace/apps/sample-verifier/build.gradle b/liferay-workspace/apps/sample-verifier/build.gradle
index cbe2ed352..68d3a75f3 100644
--- a/liferay-workspace/apps/sample-verifier/build.gradle
+++ b/liferay-workspace/apps/sample-verifier/build.gradle
@@ -1,5 +1,5 @@
dependencies {
- compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "4.4.0"
- compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations", version: "1.3.0"
- compileOnly group: "org.osgi", name: "osgi.core", version: "6.0.0"
+ compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel"
+ compileOnly group: "org.osgi", name: "org.osgi.core"
+ compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations"
}
\ No newline at end of file
diff --git a/liferay-workspace/apps/sample-verifier/src/main/java/com/liferay/blade/samples/verifier/VerifySample.java b/liferay-workspace/apps/sample-verifier/src/main/java/com/liferay/blade/samples/verifier/VerifySample.java
index 1c9108f6a..fa1a1153f 100644
--- a/liferay-workspace/apps/sample-verifier/src/main/java/com/liferay/blade/samples/verifier/VerifySample.java
+++ b/liferay-workspace/apps/sample-verifier/src/main/java/com/liferay/blade/samples/verifier/VerifySample.java
@@ -114,8 +114,6 @@ private void _verifyBundleComponents(Bundle bundle) {
sr -> sr.getProperty("objectClass") instanceof String[]
).forEach(
sr -> {
- String type = ((String[])sr.getProperty("objectClass"))[0];
-
Bundle[] usingBundles = Optional.ofNullable(
sr.getUsingBundles()
).orElseGet(
@@ -123,6 +121,8 @@ private void _verifyBundleComponents(Bundle bundle) {
);
if (usingBundles.length > 0) {
+ String type = ((String[])sr.getProperty("objectClass"))[0];
+
_messages.append(
"\t" + _CHECK + "\tService{" + type + "} used by " +
usingBundles[0].getSymbolicName() + "\n");
diff --git a/liferay-workspace/apps/service-builder/adq/adq-api/build.gradle b/liferay-workspace/apps/service-builder/adq/adq-api/build.gradle
index 9b18421a9..b61ddeccd 100644
--- a/liferay-workspace/apps/service-builder/adq/adq-api/build.gradle
+++ b/liferay-workspace/apps/service-builder/adq/adq-api/build.gradle
@@ -1,10 +1,10 @@
dependencies {
- compileOnly group: "biz.aQute.bnd", name: "biz.aQute.bndlib", version: "3.5.0"
- compileOnly group: "com.liferay", name: "com.liferay.osgi.service.tracker.collections", version: "2.0.0"
- compileOnly group: "com.liferay", name: "com.liferay.petra.lang", version: "3.0.0"
- compileOnly group: "com.liferay", name: "com.liferay.petra.string", version: "3.0.0"
- compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "4.4.0"
- compileOnly group: "org.osgi", name: "org.osgi.annotation.versioning", version: "1.1.0"
- compileOnly group: "org.osgi", name: "org.osgi.core", version: "6.0.0"
- compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations", version: "1.3.0"
-}
+ compileOnly group: "biz.aQute.bnd", name: "biz.aQute.bndlib", version: "4.3.0"
+ compileOnly group: "com.liferay", name: "com.liferay.osgi.service.tracker.collections"
+ compileOnly group: "com.liferay", name: "com.liferay.petra.lang"
+ compileOnly group: "com.liferay", name: "com.liferay.petra.string"
+ compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel"
+ compileOnly group: "org.osgi", name: "org.osgi.annotation.versioning"
+ compileOnly group: "org.osgi", name: "org.osgi.core"
+ compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations"
+}
\ No newline at end of file
diff --git a/liferay-workspace/apps/service-builder/adq/adq-service/build.gradle b/liferay-workspace/apps/service-builder/adq/adq-service/build.gradle
index c99ce229d..a7f0ce971 100644
--- a/liferay-workspace/apps/service-builder/adq/adq-service/build.gradle
+++ b/liferay-workspace/apps/service-builder/adq/adq-service/build.gradle
@@ -6,17 +6,17 @@ buildService {
}
dependencies {
- compileOnly group: "biz.aQute.bnd", name: "biz.aQute.bndlib", version: "3.5.0"
- compileOnly group: "com.liferay", name: "com.liferay.osgi.service.tracker.collections", version: "2.0.0"
- compileOnly group: "com.liferay", name: "com.liferay.petra.io", version: "3.0.0"
- compileOnly group: "com.liferay", name: "com.liferay.petra.lang", version: "3.0.0"
- compileOnly group: "com.liferay", name: "com.liferay.petra.string", version: "3.0.0"
- compileOnly group: "com.liferay", name: "com.liferay.portal.aop.api", version: "1.0.0"
- compileOnly group: "com.liferay", name: "com.liferay.portal.spring.extender", version: "2.0.0"
- compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "4.4.0"
- compileOnly group: "org.osgi", name: "org.osgi.annotation.versioning", version: "1.1.0"
- compileOnly group: "org.osgi", name: "org.osgi.core", version: "6.0.0"
- compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations", version: "1.3.0"
+ compileOnly group: "biz.aQute.bnd", name: "biz.aQute.bndlib", version: "4.3.0"
+ compileOnly group: "com.liferay", name: "com.liferay.osgi.service.tracker.collections"
+ compileOnly group: "com.liferay", name: "com.liferay.petra.io"
+ compileOnly group: "com.liferay", name: "com.liferay.petra.lang"
+ compileOnly group: "com.liferay", name: "com.liferay.petra.string"
+ compileOnly group: "com.liferay", name: "com.liferay.portal.aop.api"
+ compileOnly group: "com.liferay", name: "com.liferay.portal.spring.extender.api"
+ compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel"
+ compileOnly group: "org.osgi", name: "org.osgi.annotation.versioning"
+ compileOnly group: "org.osgi", name: "org.osgi.core"
+ compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations"
compileOnly project(":apps:service-builder:adq:adq-api")
testCompile group: "biz.aQute.bnd", name: "biz.aQute.remote.api", version: "3.3.0"
@@ -51,4 +51,4 @@ testIntegration {
finalizedBy {
stopTestableTomcat
}
-}
+}
\ No newline at end of file
diff --git a/liferay-workspace/apps/service-builder/adq/adq-web/build.gradle b/liferay-workspace/apps/service-builder/adq/adq-web/build.gradle
index f2de2015b..a9f398d8c 100644
--- a/liferay-workspace/apps/service-builder/adq/adq-web/build.gradle
+++ b/liferay-workspace/apps/service-builder/adq/adq-web/build.gradle
@@ -1,9 +1,9 @@
dependencies {
- compileOnly group: "com.liferay", name: "com.liferay.petra.lang", version: "3.0.0"
- compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "4.4.0"
- compileOnly group: "com.liferay.portal", name: "com.liferay.util.taglib", version: "4.0.8"
- compileOnly group: "javax.portlet", name: "portlet-api", version: "3.0.0"
- compileOnly group: "javax.servlet", name: "javax.servlet-api", version: "3.0.1"
- compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations", version: "1.3.0"
+ compileOnly group: "com.liferay", name: "com.liferay.petra.lang"
+ compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel"
+ compileOnly group: "com.liferay.portal", name: "com.liferay.util.taglib"
+ compileOnly group: "javax.portlet", name: "portlet-api"
+ compileOnly group: "javax.servlet", name: "javax.servlet-api"
+ compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations"
compileOnly project(":apps:service-builder:adq:adq-api")
}
\ No newline at end of file
diff --git a/liferay-workspace/apps/service-builder/basic/basic-api/build.gradle b/liferay-workspace/apps/service-builder/basic/basic-api/build.gradle
index 6e6b28f9b..500083798 100644
--- a/liferay-workspace/apps/service-builder/basic/basic-api/build.gradle
+++ b/liferay-workspace/apps/service-builder/basic/basic-api/build.gradle
@@ -1,8 +1,8 @@
dependencies {
- compileOnly group: "com.liferay", name: "com.liferay.petra.lang", version: "3.0.0"
- compileOnly group: "com.liferay", name: "com.liferay.petra.string", version: "3.0.0"
- compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "4.4.0"
- compileOnly group: "org.osgi", name: "org.osgi.annotation.versioning", version: "1.1.0"
- compileOnly group: "org.osgi", name: "org.osgi.core", version: "6.0.0"
- compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations", version: "1.3.0"
-}
+ compileOnly group: "com.liferay", name: "com.liferay.petra.lang"
+ compileOnly group: "com.liferay", name: "com.liferay.petra.string"
+ compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel"
+ compileOnly group: "org.osgi", name: "org.osgi.annotation.versioning"
+ compileOnly group: "org.osgi", name: "org.osgi.core"
+ compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations"
+}
\ No newline at end of file
diff --git a/liferay-workspace/apps/service-builder/basic/basic-service/build.gradle b/liferay-workspace/apps/service-builder/basic/basic-service/build.gradle
index 338773852..7ce241cd9 100644
--- a/liferay-workspace/apps/service-builder/basic/basic-service/build.gradle
+++ b/liferay-workspace/apps/service-builder/basic/basic-service/build.gradle
@@ -6,13 +6,13 @@ buildService {
}
dependencies {
- compileOnly group: "com.liferay", name: "com.liferay.petra.io", version: "3.0.0"
- compileOnly group: "com.liferay", name: "com.liferay.petra.lang", version: "3.0.0"
- compileOnly group: "com.liferay", name: "com.liferay.petra.string", version: "3.0.0"
- compileOnly group: "com.liferay", name: "com.liferay.portal.aop.api", version: "1.0.0"
- compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "4.4.0"
- compileOnly group: "org.osgi", name: "org.osgi.annotation.versioning", version: "1.1.0"
- compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations", version: "1.3.0"
- compileOnly group: "org.osgi", name: "osgi.core", version: "6.0.0"
+ compileOnly group: "com.liferay", name: "com.liferay.petra.io"
+ compileOnly group: "com.liferay", name: "com.liferay.petra.lang"
+ compileOnly group: "com.liferay", name: "com.liferay.petra.string"
+ compileOnly group: "com.liferay", name: "com.liferay.portal.aop.api"
+ compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel"
+ compileOnly group: "org.osgi", name: "org.osgi.annotation.versioning"
+ compileOnly group: "org.osgi", name: "org.osgi.core"
+ compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations"
compileOnly project(":apps:service-builder:basic:basic-api")
-}
+}
\ No newline at end of file
diff --git a/liferay-workspace/apps/service-builder/basic/basic-test/build.gradle b/liferay-workspace/apps/service-builder/basic/basic-test/build.gradle
index 44b44e1a8..bbd382b18 100644
--- a/liferay-workspace/apps/service-builder/basic/basic-test/build.gradle
+++ b/liferay-workspace/apps/service-builder/basic/basic-test/build.gradle
@@ -1,11 +1,11 @@
dependencies {
- compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "4.4.0"
- compileOnly group: "javax.portlet", name: "portlet-api", version: "2.0"
- compileOnly group: "javax.servlet", name: "javax.servlet-api", version: "3.0.1"
- compileOnly group: "junit", name: "junit", version: "4.12"
- compileOnly group: "org.osgi", name: "org.osgi.annotation.versioning", version: "1.1.0"
- compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations", version: "1.3.0"
- compileOnly group: "org.osgi", name: "osgi.core", version: "6.0.0"
+ compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel"
+ compileOnly group: "javax.portlet", name: "portlet-api"
+ compileOnly group: "javax.servlet", name: "javax.servlet-api"
+ compileOnly group: "junit", name: "junit"
+ compileOnly group: "org.osgi", name: "org.osgi.annotation.versioning"
+ compileOnly group: "org.osgi", name: "org.osgi.core"
+ compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations"
compileOnly project(":apps:service-builder:basic:basic-api")
}
diff --git a/liferay-workspace/apps/service-builder/basic/basic-web/build.gradle b/liferay-workspace/apps/service-builder/basic/basic-web/build.gradle
index afae23e91..37d0d527f 100644
--- a/liferay-workspace/apps/service-builder/basic/basic-web/build.gradle
+++ b/liferay-workspace/apps/service-builder/basic/basic-web/build.gradle
@@ -1,9 +1,9 @@
dependencies {
- compileOnly group: "com.liferay", name: "com.liferay.petra.lang", version: "3.0.0"
- compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "4.4.0"
- compileOnly group: "com.liferay.portal", name: "com.liferay.util.taglib", version: "4.0.8"
- compileOnly group: "javax.portlet", name: "portlet-api", version: "3.0.0"
- compileOnly group: "javax.servlet", name: "javax.servlet-api", version: "3.0.1"
- compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations", version: "1.3.0"
+ compileOnly group: "com.liferay", name: "com.liferay.petra.lang"
+ compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel"
+ compileOnly group: "com.liferay.portal", name: "com.liferay.util.taglib"
+ compileOnly group: "javax.portlet", name: "portlet-api"
+ compileOnly group: "javax.servlet", name: "javax.servlet-api"
+ compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations"
compileOnly project(":apps:service-builder:basic:basic-api")
}
\ No newline at end of file
diff --git a/liferay-workspace/apps/service-builder/dsp/dsp-api/bnd.bnd b/liferay-workspace/apps/service-builder/dsp/dsp-api/bnd.bnd
new file mode 100644
index 000000000..492cee8f5
--- /dev/null
+++ b/liferay-workspace/apps/service-builder/dsp/dsp-api/bnd.bnd
@@ -0,0 +1,10 @@
+Bundle-Name: dsp-api
+Bundle-SymbolicName: com.liferay.blade.samples.dspservicebuilder.api
+Bundle-Version: 1.0.0
+Export-Package:\
+ com.liferay.blade.samples.dspservicebuilder.exception,\
+ com.liferay.blade.samples.dspservicebuilder.model,\
+ com.liferay.blade.samples.dspservicebuilder.service,\
+ com.liferay.blade.samples.dspservicebuilder.service.persistence
+-check: EXPORTS
+-includeresource: META-INF/service.xml=../dsp-service/service.xml
\ No newline at end of file
diff --git a/liferay-workspace/apps/service-builder/dsp/dsp-api/build.gradle b/liferay-workspace/apps/service-builder/dsp/dsp-api/build.gradle
new file mode 100644
index 000000000..500083798
--- /dev/null
+++ b/liferay-workspace/apps/service-builder/dsp/dsp-api/build.gradle
@@ -0,0 +1,8 @@
+dependencies {
+ compileOnly group: "com.liferay", name: "com.liferay.petra.lang"
+ compileOnly group: "com.liferay", name: "com.liferay.petra.string"
+ compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel"
+ compileOnly group: "org.osgi", name: "org.osgi.annotation.versioning"
+ compileOnly group: "org.osgi", name: "org.osgi.core"
+ compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations"
+}
\ No newline at end of file
diff --git a/liferay-workspace/apps/service-builder/dsp/dsp-api/src/main/java/com/liferay/blade/samples/dspservicebuilder/exception/NoSuchCountryException.java b/liferay-workspace/apps/service-builder/dsp/dsp-api/src/main/java/com/liferay/blade/samples/dspservicebuilder/exception/NoSuchCountryException.java
new file mode 100644
index 000000000..5e345936d
--- /dev/null
+++ b/liferay-workspace/apps/service-builder/dsp/dsp-api/src/main/java/com/liferay/blade/samples/dspservicebuilder/exception/NoSuchCountryException.java
@@ -0,0 +1,41 @@
+/**
+ * Copyright 2000-present Liferay, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.liferay.blade.samples.dspservicebuilder.exception;
+
+import com.liferay.portal.kernel.exception.NoSuchModelException;
+
+/**
+ * @author Brian Wing Shun Chan
+ */
+public class NoSuchCountryException extends NoSuchModelException {
+
+ public NoSuchCountryException() {
+ }
+
+ public NoSuchCountryException(String msg) {
+ super(msg);
+ }
+
+ public NoSuchCountryException(String msg, Throwable cause) {
+ super(msg, cause);
+ }
+
+ public NoSuchCountryException(Throwable cause) {
+ super(cause);
+ }
+
+}
\ No newline at end of file
diff --git a/liferay-workspace/apps/service-builder/dsp/dsp-api/src/main/java/com/liferay/blade/samples/dspservicebuilder/model/Country.java b/liferay-workspace/apps/service-builder/dsp/dsp-api/src/main/java/com/liferay/blade/samples/dspservicebuilder/model/Country.java
new file mode 100644
index 000000000..4d742e22c
--- /dev/null
+++ b/liferay-workspace/apps/service-builder/dsp/dsp-api/src/main/java/com/liferay/blade/samples/dspservicebuilder/model/Country.java
@@ -0,0 +1,63 @@
+/**
+ * Copyright 2000-present Liferay, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.liferay.blade.samples.dspservicebuilder.model;
+
+import com.liferay.portal.kernel.annotation.ImplementationClassName;
+import com.liferay.portal.kernel.model.PersistedModel;
+import com.liferay.portal.kernel.util.Accessor;
+
+import org.osgi.annotation.versioning.ProviderType;
+
+/**
+ * The extended model interface for the Country service. Represents a row in the "country" database table, with each column mapped to a property of this class.
+ *
+ * @author Brian Wing Shun Chan
+ * @see CountryModel
+ * @generated
+ */
+@ImplementationClassName(
+ "com.liferay.blade.samples.dspservicebuilder.model.impl.CountryImpl"
+)
+@ProviderType
+public interface Country extends CountryModel, PersistedModel {
+
+ /*
+ * NOTE FOR DEVELOPERS:
+ *
+ * Never modify this interface directly. Add methods to com.liferay.blade.samples.dspservicebuilder.model.impl.CountryImpl
and rerun ServiceBuilder to automatically copy the method declarations to this interface.
+ */
+ public static final Accessor COUNTRY_ID_ACCESSOR =
+ new Accessor() {
+
+ @Override
+ public Long get(Country country) {
+ return country.getCountryId();
+ }
+
+ @Override
+ public Class getAttributeClass() {
+ return Long.class;
+ }
+
+ @Override
+ public Class getTypeClass() {
+ return Country.class;
+ }
+
+ };
+
+}
\ No newline at end of file
diff --git a/liferay-workspace/apps/service-builder/dsp/dsp-api/src/main/java/com/liferay/blade/samples/dspservicebuilder/model/CountryModel.java b/liferay-workspace/apps/service-builder/dsp/dsp-api/src/main/java/com/liferay/blade/samples/dspservicebuilder/model/CountryModel.java
new file mode 100644
index 000000000..875112a1a
--- /dev/null
+++ b/liferay-workspace/apps/service-builder/dsp/dsp-api/src/main/java/com/liferay/blade/samples/dspservicebuilder/model/CountryModel.java
@@ -0,0 +1,87 @@
+/**
+ * Copyright 2000-present Liferay, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.liferay.blade.samples.dspservicebuilder.model;
+
+import com.liferay.portal.kernel.bean.AutoEscape;
+import com.liferay.portal.kernel.model.BaseModel;
+
+import org.osgi.annotation.versioning.ProviderType;
+
+/**
+ * The base model interface for the Country service. Represents a row in the "country" database table, with each column mapped to a property of this class.
+ *
+ *
+ * This interface and its corresponding implementation com.liferay.blade.samples.dspservicebuilder.model.impl.CountryModelImpl
exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in com.liferay.blade.samples.dspservicebuilder.model.impl.CountryImpl
.
+ *
+ *
+ * @author Brian Wing Shun Chan
+ * @see Country
+ * @generated
+ */
+@ProviderType
+public interface CountryModel extends BaseModel {
+
+ /*
+ * NOTE FOR DEVELOPERS:
+ *
+ * Never modify or reference this interface directly. All methods that expect a country model instance should use the {@link Country} interface instead.
+ */
+
+ /**
+ * Returns the primary key of this country.
+ *
+ * @return the primary key of this country
+ */
+ public long getPrimaryKey();
+
+ /**
+ * Sets the primary key of this country.
+ *
+ * @param primaryKey the primary key of this country
+ */
+ public void setPrimaryKey(long primaryKey);
+
+ /**
+ * Returns the country ID of this country.
+ *
+ * @return the country ID of this country
+ */
+ public long getCountryId();
+
+ /**
+ * Sets the country ID of this country.
+ *
+ * @param countryId the country ID of this country
+ */
+ public void setCountryId(long countryId);
+
+ /**
+ * Returns the country name of this country.
+ *
+ * @return the country name of this country
+ */
+ @AutoEscape
+ public String getCountryName();
+
+ /**
+ * Sets the country name of this country.
+ *
+ * @param countryName the country name of this country
+ */
+ public void setCountryName(String countryName);
+
+}
\ No newline at end of file
diff --git a/liferay-workspace/apps/service-builder/dsp/dsp-api/src/main/java/com/liferay/blade/samples/dspservicebuilder/model/CountrySoap.java b/liferay-workspace/apps/service-builder/dsp/dsp-api/src/main/java/com/liferay/blade/samples/dspservicebuilder/model/CountrySoap.java
new file mode 100644
index 000000000..64e3b4293
--- /dev/null
+++ b/liferay-workspace/apps/service-builder/dsp/dsp-api/src/main/java/com/liferay/blade/samples/dspservicebuilder/model/CountrySoap.java
@@ -0,0 +1,109 @@
+/**
+ * Copyright 2000-present Liferay, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.liferay.blade.samples.dspservicebuilder.model;
+
+import java.io.Serializable;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * This class is used by SOAP remote services.
+ *
+ * @author Brian Wing Shun Chan
+ * @generated
+ */
+public class CountrySoap implements Serializable {
+
+ public static CountrySoap toSoapModel(Country model) {
+ CountrySoap soapModel = new CountrySoap();
+
+ soapModel.setCountryId(model.getCountryId());
+ soapModel.setCountryName(model.getCountryName());
+
+ return soapModel;
+ }
+
+ public static CountrySoap[] toSoapModels(Country[] models) {
+ CountrySoap[] soapModels = new CountrySoap[models.length];
+
+ for (int i = 0; i < models.length; i++) {
+ soapModels[i] = toSoapModel(models[i]);
+ }
+
+ return soapModels;
+ }
+
+ public static CountrySoap[][] toSoapModels(Country[][] models) {
+ CountrySoap[][] soapModels = null;
+
+ if (models.length > 0) {
+ soapModels = new CountrySoap[models.length][models[0].length];
+ }
+ else {
+ soapModels = new CountrySoap[0][0];
+ }
+
+ for (int i = 0; i < models.length; i++) {
+ soapModels[i] = toSoapModels(models[i]);
+ }
+
+ return soapModels;
+ }
+
+ public static CountrySoap[] toSoapModels(List models) {
+ List soapModels = new ArrayList(
+ models.size());
+
+ for (Country model : models) {
+ soapModels.add(toSoapModel(model));
+ }
+
+ return soapModels.toArray(new CountrySoap[soapModels.size()]);
+ }
+
+ public CountrySoap() {
+ }
+
+ public long getPrimaryKey() {
+ return _countryId;
+ }
+
+ public void setPrimaryKey(long pk) {
+ setCountryId(pk);
+ }
+
+ public long getCountryId() {
+ return _countryId;
+ }
+
+ public void setCountryId(long countryId) {
+ _countryId = countryId;
+ }
+
+ public String getCountryName() {
+ return _countryName;
+ }
+
+ public void setCountryName(String countryName) {
+ _countryName = countryName;
+ }
+
+ private long _countryId;
+ private String _countryName;
+
+}
\ No newline at end of file
diff --git a/liferay-workspace/apps/service-builder/dsp/dsp-api/src/main/java/com/liferay/blade/samples/dspservicebuilder/model/CountryWrapper.java b/liferay-workspace/apps/service-builder/dsp/dsp-api/src/main/java/com/liferay/blade/samples/dspservicebuilder/model/CountryWrapper.java
new file mode 100644
index 000000000..c494591d8
--- /dev/null
+++ b/liferay-workspace/apps/service-builder/dsp/dsp-api/src/main/java/com/liferay/blade/samples/dspservicebuilder/model/CountryWrapper.java
@@ -0,0 +1,137 @@
+/**
+ * Copyright 2000-present Liferay, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.liferay.blade.samples.dspservicebuilder.model;
+
+import com.liferay.portal.kernel.model.ModelWrapper;
+import com.liferay.portal.kernel.model.wrapper.BaseModelWrapper;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ *
+ * This class is a wrapper for {@link Country}.
+ *
+ *
+ * @author Brian Wing Shun Chan
+ * @see Country
+ * @generated
+ */
+public class CountryWrapper
+ extends BaseModelWrapper
+ implements Country, ModelWrapper {
+
+ public CountryWrapper(Country country) {
+ super(country);
+ }
+
+ @Override
+ public Map getModelAttributes() {
+ Map attributes = new HashMap();
+
+ attributes.put("countryId", getCountryId());
+ attributes.put("countryName", getCountryName());
+
+ return attributes;
+ }
+
+ @Override
+ public void setModelAttributes(Map attributes) {
+ Long countryId = (Long)attributes.get("countryId");
+
+ if (countryId != null) {
+ setCountryId(countryId);
+ }
+
+ String countryName = (String)attributes.get("countryName");
+
+ if (countryName != null) {
+ setCountryName(countryName);
+ }
+ }
+
+ /**
+ * Returns the country ID of this country.
+ *
+ * @return the country ID of this country
+ */
+ @Override
+ public long getCountryId() {
+ return model.getCountryId();
+ }
+
+ /**
+ * Returns the country name of this country.
+ *
+ * @return the country name of this country
+ */
+ @Override
+ public String getCountryName() {
+ return model.getCountryName();
+ }
+
+ /**
+ * Returns the primary key of this country.
+ *
+ * @return the primary key of this country
+ */
+ @Override
+ public long getPrimaryKey() {
+ return model.getPrimaryKey();
+ }
+
+ @Override
+ public void persist() {
+ model.persist();
+ }
+
+ /**
+ * Sets the country ID of this country.
+ *
+ * @param countryId the country ID of this country
+ */
+ @Override
+ public void setCountryId(long countryId) {
+ model.setCountryId(countryId);
+ }
+
+ /**
+ * Sets the country name of this country.
+ *
+ * @param countryName the country name of this country
+ */
+ @Override
+ public void setCountryName(String countryName) {
+ model.setCountryName(countryName);
+ }
+
+ /**
+ * Sets the primary key of this country.
+ *
+ * @param primaryKey the primary key of this country
+ */
+ @Override
+ public void setPrimaryKey(long primaryKey) {
+ model.setPrimaryKey(primaryKey);
+ }
+
+ @Override
+ protected CountryWrapper wrap(Country country) {
+ return new CountryWrapper(country);
+ }
+
+}
\ No newline at end of file
diff --git a/liferay-workspace/apps/service-builder/dsp/dsp-api/src/main/java/com/liferay/blade/samples/dspservicebuilder/service/CountryLocalService.java b/liferay-workspace/apps/service-builder/dsp/dsp-api/src/main/java/com/liferay/blade/samples/dspservicebuilder/service/CountryLocalService.java
new file mode 100644
index 000000000..2908f8d21
--- /dev/null
+++ b/liferay-workspace/apps/service-builder/dsp/dsp-api/src/main/java/com/liferay/blade/samples/dspservicebuilder/service/CountryLocalService.java
@@ -0,0 +1,243 @@
+/**
+ * Copyright 2000-present Liferay, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.liferay.blade.samples.dspservicebuilder.service;
+
+import com.liferay.blade.samples.dspservicebuilder.model.Country;
+import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
+import com.liferay.portal.kernel.dao.orm.DynamicQuery;
+import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
+import com.liferay.portal.kernel.dao.orm.Projection;
+import com.liferay.portal.kernel.exception.PortalException;
+import com.liferay.portal.kernel.exception.SystemException;
+import com.liferay.portal.kernel.model.PersistedModel;
+import com.liferay.portal.kernel.search.Indexable;
+import com.liferay.portal.kernel.search.IndexableType;
+import com.liferay.portal.kernel.service.BaseLocalService;
+import com.liferay.portal.kernel.service.PersistedModelLocalService;
+import com.liferay.portal.kernel.transaction.Isolation;
+import com.liferay.portal.kernel.transaction.Propagation;
+import com.liferay.portal.kernel.transaction.Transactional;
+import com.liferay.portal.kernel.util.OrderByComparator;
+
+import java.io.Serializable;
+
+import java.util.List;
+
+import org.osgi.annotation.versioning.ProviderType;
+
+/**
+ * Provides the local service interface for Country. Methods of this
+ * service will not have security checks based on the propagated JAAS
+ * credentials because this service can only be accessed from within the same
+ * VM.
+ *
+ * @author Brian Wing Shun Chan
+ * @see CountryLocalServiceUtil
+ * @generated
+ */
+@ProviderType
+@Transactional(
+ isolation = Isolation.PORTAL,
+ rollbackFor = {PortalException.class, SystemException.class}
+)
+public interface CountryLocalService
+ extends BaseLocalService, PersistedModelLocalService {
+
+ /*
+ * NOTE FOR DEVELOPERS:
+ *
+ * Never modify or reference this interface directly. Always use {@link CountryLocalServiceUtil} to access the country local service. Add custom service methods to com.liferay.blade.samples.dspservicebuilder.service.impl.CountryLocalServiceImpl
and rerun ServiceBuilder to automatically copy the method declarations to this interface.
+ */
+
+ /**
+ * Adds the country to the database. Also notifies the appropriate model listeners.
+ *
+ * @param country the country
+ * @return the country that was added
+ */
+ @Indexable(type = IndexableType.REINDEX)
+ public Country addCountry(Country country);
+
+ /**
+ * Creates a new country with the primary key. Does not add the country to the database.
+ *
+ * @param countryId the primary key for the new country
+ * @return the new country
+ */
+ @Transactional(enabled = false)
+ public Country createCountry(long countryId);
+
+ /**
+ * Deletes the country from the database. Also notifies the appropriate model listeners.
+ *
+ * @param country the country
+ * @return the country that was removed
+ */
+ @Indexable(type = IndexableType.DELETE)
+ public Country deleteCountry(Country country);
+
+ /**
+ * Deletes the country with the primary key from the database. Also notifies the appropriate model listeners.
+ *
+ * @param countryId the primary key of the country
+ * @return the country that was removed
+ * @throws PortalException if a country with the primary key could not be found
+ */
+ @Indexable(type = IndexableType.DELETE)
+ public Country deleteCountry(long countryId) throws PortalException;
+
+ /**
+ * @throws PortalException
+ */
+ @Override
+ public PersistedModel deletePersistedModel(PersistedModel persistedModel)
+ throws PortalException;
+
+ @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
+ public DynamicQuery dynamicQuery();
+
+ /**
+ * Performs a dynamic query on the database and returns the matching rows.
+ *
+ * @param dynamicQuery the dynamic query
+ * @return the matching rows
+ */
+ @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
+ public List dynamicQuery(DynamicQuery dynamicQuery);
+
+ /**
+ * Performs a dynamic query on the database and returns a range of the matching rows.
+ *
+ *
+ * Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent, then the query will include the default ORDER BY logic from com.liferay.blade.samples.dspservicebuilder.model.impl.CountryModelImpl
.
+ *
+ *
+ * @param dynamicQuery the dynamic query
+ * @param start the lower bound of the range of model instances
+ * @param end the upper bound of the range of model instances (not inclusive)
+ * @return the range of matching rows
+ */
+ @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
+ public List dynamicQuery(
+ DynamicQuery dynamicQuery, int start, int end);
+
+ /**
+ * Performs a dynamic query on the database and returns an ordered range of the matching rows.
+ *
+ *
+ * Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent, then the query will include the default ORDER BY logic from com.liferay.blade.samples.dspservicebuilder.model.impl.CountryModelImpl
.
+ *
+ *
+ * @param dynamicQuery the dynamic query
+ * @param start the lower bound of the range of model instances
+ * @param end the upper bound of the range of model instances (not inclusive)
+ * @param orderByComparator the comparator to order the results by (optionally null
)
+ * @return the ordered range of matching rows
+ */
+ @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
+ public List dynamicQuery(
+ DynamicQuery dynamicQuery, int start, int end,
+ OrderByComparator orderByComparator);
+
+ /**
+ * Returns the number of rows matching the dynamic query.
+ *
+ * @param dynamicQuery the dynamic query
+ * @return the number of rows matching the dynamic query
+ */
+ @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
+ public long dynamicQueryCount(DynamicQuery dynamicQuery);
+
+ /**
+ * Returns the number of rows matching the dynamic query.
+ *
+ * @param dynamicQuery the dynamic query
+ * @param projection the projection to apply to the query
+ * @return the number of rows matching the dynamic query
+ */
+ @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
+ public long dynamicQueryCount(
+ DynamicQuery dynamicQuery, Projection projection);
+
+ @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
+ public Country fetchCountry(long countryId);
+
+ @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
+ public ActionableDynamicQuery getActionableDynamicQuery();
+
+ /**
+ * Returns a range of all the countries.
+ *
+ *
+ * Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent, then the query will include the default ORDER BY logic from com.liferay.blade.samples.dspservicebuilder.model.impl.CountryModelImpl
.
+ *
+ *
+ * @param start the lower bound of the range of countries
+ * @param end the upper bound of the range of countries (not inclusive)
+ * @return the range of countries
+ */
+ @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
+ public List getCountries(int start, int end);
+
+ /**
+ * Returns the number of countries.
+ *
+ * @return the number of countries
+ */
+ @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
+ public int getCountriesCount();
+
+ /**
+ * Returns the country with the primary key.
+ *
+ * @param countryId the primary key of the country
+ * @return the country
+ * @throws PortalException if a country with the primary key could not be found
+ */
+ @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
+ public Country getCountry(long countryId) throws PortalException;
+
+ @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
+ public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
+
+ /**
+ * Returns the OSGi service identifier.
+ *
+ * @return the OSGi service identifier
+ */
+ public String getOSGiServiceIdentifier();
+
+ /**
+ * @throws PortalException
+ */
+ @Override
+ @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
+ public PersistedModel getPersistedModel(Serializable primaryKeyObj)
+ throws PortalException;
+
+ /**
+ * Updates the country in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
+ *
+ * @param country the country
+ * @return the country that was updated
+ */
+ @Indexable(type = IndexableType.REINDEX)
+ public Country updateCountry(Country country);
+
+ public void useDSP();
+
+}
\ No newline at end of file
diff --git a/liferay-workspace/apps/service-builder/dsp/dsp-api/src/main/java/com/liferay/blade/samples/dspservicebuilder/service/CountryLocalServiceUtil.java b/liferay-workspace/apps/service-builder/dsp/dsp-api/src/main/java/com/liferay/blade/samples/dspservicebuilder/service/CountryLocalServiceUtil.java
new file mode 100644
index 000000000..8bf3253c6
--- /dev/null
+++ b/liferay-workspace/apps/service-builder/dsp/dsp-api/src/main/java/com/liferay/blade/samples/dspservicebuilder/service/CountryLocalServiceUtil.java
@@ -0,0 +1,307 @@
+/**
+ * Copyright 2000-present Liferay, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.liferay.blade.samples.dspservicebuilder.service;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.util.tracker.ServiceTracker;
+
+/**
+ * Provides the local service utility for Country. This utility wraps
+ * com.liferay.blade.samples.dspservicebuilder.service.impl.CountryLocalServiceImpl
and
+ * is an access point for service operations in application layer code running
+ * on the local server. Methods of this service will not have security checks
+ * based on the propagated JAAS credentials because this service can only be
+ * accessed from within the same VM.
+ *
+ * @author Brian Wing Shun Chan
+ * @see CountryLocalService
+ * @generated
+ */
+public class CountryLocalServiceUtil {
+
+ /*
+ * NOTE FOR DEVELOPERS:
+ *
+ * Never modify this class directly. Add custom service methods to com.liferay.blade.samples.dspservicebuilder.service.impl.CountryLocalServiceImpl
and rerun ServiceBuilder to regenerate this class.
+ */
+
+ /**
+ * Adds the country to the database. Also notifies the appropriate model listeners.
+ *
+ * @param country the country
+ * @return the country that was added
+ */
+ public static com.liferay.blade.samples.dspservicebuilder.model.Country
+ addCountry(
+ com.liferay.blade.samples.dspservicebuilder.model.Country country) {
+
+ return getService().addCountry(country);
+ }
+
+ /**
+ * Creates a new country with the primary key. Does not add the country to the database.
+ *
+ * @param countryId the primary key for the new country
+ * @return the new country
+ */
+ public static com.liferay.blade.samples.dspservicebuilder.model.Country
+ createCountry(long countryId) {
+
+ return getService().createCountry(countryId);
+ }
+
+ /**
+ * Deletes the country from the database. Also notifies the appropriate model listeners.
+ *
+ * @param country the country
+ * @return the country that was removed
+ */
+ public static com.liferay.blade.samples.dspservicebuilder.model.Country
+ deleteCountry(
+ com.liferay.blade.samples.dspservicebuilder.model.Country country) {
+
+ return getService().deleteCountry(country);
+ }
+
+ /**
+ * Deletes the country with the primary key from the database. Also notifies the appropriate model listeners.
+ *
+ * @param countryId the primary key of the country
+ * @return the country that was removed
+ * @throws PortalException if a country with the primary key could not be found
+ */
+ public static com.liferay.blade.samples.dspservicebuilder.model.Country
+ deleteCountry(long countryId)
+ throws com.liferay.portal.kernel.exception.PortalException {
+
+ return getService().deleteCountry(countryId);
+ }
+
+ /**
+ * @throws PortalException
+ */
+ public static com.liferay.portal.kernel.model.PersistedModel
+ deletePersistedModel(
+ com.liferay.portal.kernel.model.PersistedModel persistedModel)
+ throws com.liferay.portal.kernel.exception.PortalException {
+
+ return getService().deletePersistedModel(persistedModel);
+ }
+
+ public static com.liferay.portal.kernel.dao.orm.DynamicQuery
+ dynamicQuery() {
+
+ return getService().dynamicQuery();
+ }
+
+ /**
+ * Performs a dynamic query on the database and returns the matching rows.
+ *
+ * @param dynamicQuery the dynamic query
+ * @return the matching rows
+ */
+ public static java.util.List dynamicQuery(
+ com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
+
+ return getService().dynamicQuery(dynamicQuery);
+ }
+
+ /**
+ * Performs a dynamic query on the database and returns a range of the matching rows.
+ *
+ *
+ * Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent, then the query will include the default ORDER BY logic from com.liferay.blade.samples.dspservicebuilder.model.impl.CountryModelImpl
.
+ *
+ *
+ * @param dynamicQuery the dynamic query
+ * @param start the lower bound of the range of model instances
+ * @param end the upper bound of the range of model instances (not inclusive)
+ * @return the range of matching rows
+ */
+ public static java.util.List dynamicQuery(
+ com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
+ int end) {
+
+ return getService().dynamicQuery(dynamicQuery, start, end);
+ }
+
+ /**
+ * Performs a dynamic query on the database and returns an ordered range of the matching rows.
+ *
+ *
+ * Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent, then the query will include the default ORDER BY logic from com.liferay.blade.samples.dspservicebuilder.model.impl.CountryModelImpl
.
+ *
+ *
+ * @param dynamicQuery the dynamic query
+ * @param start the lower bound of the range of model instances
+ * @param end the upper bound of the range of model instances (not inclusive)
+ * @param orderByComparator the comparator to order the results by (optionally null
)
+ * @return the ordered range of matching rows
+ */
+ public static java.util.List dynamicQuery(
+ com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
+ int end,
+ com.liferay.portal.kernel.util.OrderByComparator orderByComparator) {
+
+ return getService().dynamicQuery(
+ dynamicQuery, start, end, orderByComparator);
+ }
+
+ /**
+ * Returns the number of rows matching the dynamic query.
+ *
+ * @param dynamicQuery the dynamic query
+ * @return the number of rows matching the dynamic query
+ */
+ public static long dynamicQueryCount(
+ com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
+
+ return getService().dynamicQueryCount(dynamicQuery);
+ }
+
+ /**
+ * Returns the number of rows matching the dynamic query.
+ *
+ * @param dynamicQuery the dynamic query
+ * @param projection the projection to apply to the query
+ * @return the number of rows matching the dynamic query
+ */
+ public static long dynamicQueryCount(
+ com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
+ com.liferay.portal.kernel.dao.orm.Projection projection) {
+
+ return getService().dynamicQueryCount(dynamicQuery, projection);
+ }
+
+ public static com.liferay.blade.samples.dspservicebuilder.model.Country
+ fetchCountry(long countryId) {
+
+ return getService().fetchCountry(countryId);
+ }
+
+ public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery
+ getActionableDynamicQuery() {
+
+ return getService().getActionableDynamicQuery();
+ }
+
+ /**
+ * Returns a range of all the countries.
+ *
+ *
+ * Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent, then the query will include the default ORDER BY logic from com.liferay.blade.samples.dspservicebuilder.model.impl.CountryModelImpl
.
+ *
+ *
+ * @param start the lower bound of the range of countries
+ * @param end the upper bound of the range of countries (not inclusive)
+ * @return the range of countries
+ */
+ public static java.util.List
+
+ getCountries(int start, int end) {
+
+ return getService().getCountries(start, end);
+ }
+
+ /**
+ * Returns the number of countries.
+ *
+ * @return the number of countries
+ */
+ public static int getCountriesCount() {
+ return getService().getCountriesCount();
+ }
+
+ /**
+ * Returns the country with the primary key.
+ *
+ * @param countryId the primary key of the country
+ * @return the country
+ * @throws PortalException if a country with the primary key could not be found
+ */
+ public static com.liferay.blade.samples.dspservicebuilder.model.Country
+ getCountry(long countryId)
+ throws com.liferay.portal.kernel.exception.PortalException {
+
+ return getService().getCountry(countryId);
+ }
+
+ public static
+ com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery
+ getIndexableActionableDynamicQuery() {
+
+ return getService().getIndexableActionableDynamicQuery();
+ }
+
+ /**
+ * Returns the OSGi service identifier.
+ *
+ * @return the OSGi service identifier
+ */
+ public static String getOSGiServiceIdentifier() {
+ return getService().getOSGiServiceIdentifier();
+ }
+
+ /**
+ * @throws PortalException
+ */
+ public static com.liferay.portal.kernel.model.PersistedModel
+ getPersistedModel(java.io.Serializable primaryKeyObj)
+ throws com.liferay.portal.kernel.exception.PortalException {
+
+ return getService().getPersistedModel(primaryKeyObj);
+ }
+
+ /**
+ * Updates the country in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
+ *
+ * @param country the country
+ * @return the country that was updated
+ */
+ public static com.liferay.blade.samples.dspservicebuilder.model.Country
+ updateCountry(
+ com.liferay.blade.samples.dspservicebuilder.model.Country country) {
+
+ return getService().updateCountry(country);
+ }
+
+ public static void useDSP() {
+ getService().useDSP();
+ }
+
+ public static CountryLocalService getService() {
+ return _serviceTracker.getService();
+ }
+
+ private static ServiceTracker
+ _serviceTracker;
+
+ static {
+ Bundle bundle = FrameworkUtil.getBundle(CountryLocalService.class);
+
+ ServiceTracker
+ serviceTracker =
+ new ServiceTracker(
+ bundle.getBundleContext(), CountryLocalService.class, null);
+
+ serviceTracker.open();
+
+ _serviceTracker = serviceTracker;
+ }
+
+}
\ No newline at end of file
diff --git a/liferay-workspace/apps/service-builder/dsp/dsp-api/src/main/java/com/liferay/blade/samples/dspservicebuilder/service/CountryLocalServiceWrapper.java b/liferay-workspace/apps/service-builder/dsp/dsp-api/src/main/java/com/liferay/blade/samples/dspservicebuilder/service/CountryLocalServiceWrapper.java
new file mode 100644
index 000000000..099e1e255
--- /dev/null
+++ b/liferay-workspace/apps/service-builder/dsp/dsp-api/src/main/java/com/liferay/blade/samples/dspservicebuilder/service/CountryLocalServiceWrapper.java
@@ -0,0 +1,307 @@
+/**
+ * Copyright 2000-present Liferay, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.liferay.blade.samples.dspservicebuilder.service;
+
+import com.liferay.portal.kernel.service.ServiceWrapper;
+
+/**
+ * Provides a wrapper for {@link CountryLocalService}.
+ *
+ * @author Brian Wing Shun Chan
+ * @see CountryLocalService
+ * @generated
+ */
+public class CountryLocalServiceWrapper
+ implements CountryLocalService, ServiceWrapper {
+
+ public CountryLocalServiceWrapper(CountryLocalService countryLocalService) {
+ _countryLocalService = countryLocalService;
+ }
+
+ /**
+ * Adds the country to the database. Also notifies the appropriate model listeners.
+ *
+ * @param country the country
+ * @return the country that was added
+ */
+ @Override
+ public com.liferay.blade.samples.dspservicebuilder.model.Country addCountry(
+ com.liferay.blade.samples.dspservicebuilder.model.Country country) {
+
+ return _countryLocalService.addCountry(country);
+ }
+
+ /**
+ * Creates a new country with the primary key. Does not add the country to the database.
+ *
+ * @param countryId the primary key for the new country
+ * @return the new country
+ */
+ @Override
+ public com.liferay.blade.samples.dspservicebuilder.model.Country
+ createCountry(long countryId) {
+
+ return _countryLocalService.createCountry(countryId);
+ }
+
+ /**
+ * Deletes the country from the database. Also notifies the appropriate model listeners.
+ *
+ * @param country the country
+ * @return the country that was removed
+ */
+ @Override
+ public com.liferay.blade.samples.dspservicebuilder.model.Country
+ deleteCountry(
+ com.liferay.blade.samples.dspservicebuilder.model.Country country) {
+
+ return _countryLocalService.deleteCountry(country);
+ }
+
+ /**
+ * Deletes the country with the primary key from the database. Also notifies the appropriate model listeners.
+ *
+ * @param countryId the primary key of the country
+ * @return the country that was removed
+ * @throws PortalException if a country with the primary key could not be found
+ */
+ @Override
+ public com.liferay.blade.samples.dspservicebuilder.model.Country
+ deleteCountry(long countryId)
+ throws com.liferay.portal.kernel.exception.PortalException {
+
+ return _countryLocalService.deleteCountry(countryId);
+ }
+
+ /**
+ * @throws PortalException
+ */
+ @Override
+ public com.liferay.portal.kernel.model.PersistedModel deletePersistedModel(
+ com.liferay.portal.kernel.model.PersistedModel persistedModel)
+ throws com.liferay.portal.kernel.exception.PortalException {
+
+ return _countryLocalService.deletePersistedModel(persistedModel);
+ }
+
+ @Override
+ public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
+ return _countryLocalService.dynamicQuery();
+ }
+
+ /**
+ * Performs a dynamic query on the database and returns the matching rows.
+ *
+ * @param dynamicQuery the dynamic query
+ * @return the matching rows
+ */
+ @Override
+ public java.util.List dynamicQuery(
+ com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
+
+ return _countryLocalService.dynamicQuery(dynamicQuery);
+ }
+
+ /**
+ * Performs a dynamic query on the database and returns a range of the matching rows.
+ *
+ *
+ * Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent, then the query will include the default ORDER BY logic from com.liferay.blade.samples.dspservicebuilder.model.impl.CountryModelImpl
.
+ *
+ *
+ * @param dynamicQuery the dynamic query
+ * @param start the lower bound of the range of model instances
+ * @param end the upper bound of the range of model instances (not inclusive)
+ * @return the range of matching rows
+ */
+ @Override
+ public java.util.List dynamicQuery(
+ com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
+ int end) {
+
+ return _countryLocalService.dynamicQuery(dynamicQuery, start, end);
+ }
+
+ /**
+ * Performs a dynamic query on the database and returns an ordered range of the matching rows.
+ *
+ *
+ * Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent, then the query will include the default ORDER BY logic from com.liferay.blade.samples.dspservicebuilder.model.impl.CountryModelImpl
.
+ *
+ *
+ * @param dynamicQuery the dynamic query
+ * @param start the lower bound of the range of model instances
+ * @param end the upper bound of the range of model instances (not inclusive)
+ * @param orderByComparator the comparator to order the results by (optionally null
)
+ * @return the ordered range of matching rows
+ */
+ @Override
+ public java.util.List dynamicQuery(
+ com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
+ int end,
+ com.liferay.portal.kernel.util.OrderByComparator orderByComparator) {
+
+ return _countryLocalService.dynamicQuery(
+ dynamicQuery, start, end, orderByComparator);
+ }
+
+ /**
+ * Returns the number of rows matching the dynamic query.
+ *
+ * @param dynamicQuery the dynamic query
+ * @return the number of rows matching the dynamic query
+ */
+ @Override
+ public long dynamicQueryCount(
+ com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
+
+ return _countryLocalService.dynamicQueryCount(dynamicQuery);
+ }
+
+ /**
+ * Returns the number of rows matching the dynamic query.
+ *
+ * @param dynamicQuery the dynamic query
+ * @param projection the projection to apply to the query
+ * @return the number of rows matching the dynamic query
+ */
+ @Override
+ public long dynamicQueryCount(
+ com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
+ com.liferay.portal.kernel.dao.orm.Projection projection) {
+
+ return _countryLocalService.dynamicQueryCount(dynamicQuery, projection);
+ }
+
+ @Override
+ public com.liferay.blade.samples.dspservicebuilder.model.Country
+ fetchCountry(long countryId) {
+
+ return _countryLocalService.fetchCountry(countryId);
+ }
+
+ @Override
+ public com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery
+ getActionableDynamicQuery() {
+
+ return _countryLocalService.getActionableDynamicQuery();
+ }
+
+ /**
+ * Returns a range of all the countries.
+ *
+ *
+ * Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent, then the query will include the default ORDER BY logic from com.liferay.blade.samples.dspservicebuilder.model.impl.CountryModelImpl
.
+ *
+ *
+ * @param start the lower bound of the range of countries
+ * @param end the upper bound of the range of countries (not inclusive)
+ * @return the range of countries
+ */
+ @Override
+ public java.util.List
+
+ getCountries(int start, int end) {
+
+ return _countryLocalService.getCountries(start, end);
+ }
+
+ /**
+ * Returns the number of countries.
+ *
+ * @return the number of countries
+ */
+ @Override
+ public int getCountriesCount() {
+ return _countryLocalService.getCountriesCount();
+ }
+
+ /**
+ * Returns the country with the primary key.
+ *
+ * @param countryId the primary key of the country
+ * @return the country
+ * @throws PortalException if a country with the primary key could not be found
+ */
+ @Override
+ public com.liferay.blade.samples.dspservicebuilder.model.Country getCountry(
+ long countryId)
+ throws com.liferay.portal.kernel.exception.PortalException {
+
+ return _countryLocalService.getCountry(countryId);
+ }
+
+ @Override
+ public com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery
+ getIndexableActionableDynamicQuery() {
+
+ return _countryLocalService.getIndexableActionableDynamicQuery();
+ }
+
+ /**
+ * Returns the OSGi service identifier.
+ *
+ * @return the OSGi service identifier
+ */
+ @Override
+ public String getOSGiServiceIdentifier() {
+ return _countryLocalService.getOSGiServiceIdentifier();
+ }
+
+ /**
+ * @throws PortalException
+ */
+ @Override
+ public com.liferay.portal.kernel.model.PersistedModel getPersistedModel(
+ java.io.Serializable primaryKeyObj)
+ throws com.liferay.portal.kernel.exception.PortalException {
+
+ return _countryLocalService.getPersistedModel(primaryKeyObj);
+ }
+
+ /**
+ * Updates the country in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
+ *
+ * @param country the country
+ * @return the country that was updated
+ */
+ @Override
+ public com.liferay.blade.samples.dspservicebuilder.model.Country
+ updateCountry(
+ com.liferay.blade.samples.dspservicebuilder.model.Country country) {
+
+ return _countryLocalService.updateCountry(country);
+ }
+
+ @Override
+ public void useDSP() {
+ _countryLocalService.useDSP();
+ }
+
+ @Override
+ public CountryLocalService getWrappedService() {
+ return _countryLocalService;
+ }
+
+ @Override
+ public void setWrappedService(CountryLocalService countryLocalService) {
+ _countryLocalService = countryLocalService;
+ }
+
+ private CountryLocalService _countryLocalService;
+
+}
\ No newline at end of file
diff --git a/liferay-workspace/apps/service-builder/dsp/dsp-api/src/main/java/com/liferay/blade/samples/dspservicebuilder/service/persistence/CountryPersistence.java b/liferay-workspace/apps/service-builder/dsp/dsp-api/src/main/java/com/liferay/blade/samples/dspservicebuilder/service/persistence/CountryPersistence.java
new file mode 100644
index 000000000..e96e901b9
--- /dev/null
+++ b/liferay-workspace/apps/service-builder/dsp/dsp-api/src/main/java/com/liferay/blade/samples/dspservicebuilder/service/persistence/CountryPersistence.java
@@ -0,0 +1,164 @@
+/**
+ * Copyright 2000-present Liferay, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.liferay.blade.samples.dspservicebuilder.service.persistence;
+
+import com.liferay.blade.samples.dspservicebuilder.exception.NoSuchCountryException;
+import com.liferay.blade.samples.dspservicebuilder.model.Country;
+import com.liferay.portal.kernel.service.persistence.BasePersistence;
+
+import org.osgi.annotation.versioning.ProviderType;
+
+/**
+ * The persistence interface for the country service.
+ *
+ *
+ * Caching information and settings can be found in portal.properties
+ *
+ *
+ * @author Brian Wing Shun Chan
+ * @see CountryUtil
+ * @generated
+ */
+@ProviderType
+public interface CountryPersistence extends BasePersistence {
+
+ /*
+ * NOTE FOR DEVELOPERS:
+ *
+ * Never modify or reference this interface directly. Always use {@link CountryUtil} to access the country persistence. Modify service.xml
and rerun ServiceBuilder to regenerate this interface.
+ */
+
+ /**
+ * Caches the country in the entity cache if it is enabled.
+ *
+ * @param country the country
+ */
+ public void cacheResult(Country country);
+
+ /**
+ * Caches the countries in the entity cache if it is enabled.
+ *
+ * @param countries the countries
+ */
+ public void cacheResult(java.util.List countries);
+
+ /**
+ * Creates a new country with the primary key. Does not add the country to the database.
+ *
+ * @param countryId the primary key for the new country
+ * @return the new country
+ */
+ public Country create(long countryId);
+
+ /**
+ * Removes the country with the primary key from the database. Also notifies the appropriate model listeners.
+ *
+ * @param countryId the primary key of the country
+ * @return the country that was removed
+ * @throws NoSuchCountryException if a country with the primary key could not be found
+ */
+ public Country remove(long countryId) throws NoSuchCountryException;
+
+ public Country updateImpl(Country country);
+
+ /**
+ * Returns the country with the primary key or throws a NoSuchCountryException
if it could not be found.
+ *
+ * @param countryId the primary key of the country
+ * @return the country
+ * @throws NoSuchCountryException if a country with the primary key could not be found
+ */
+ public Country findByPrimaryKey(long countryId)
+ throws NoSuchCountryException;
+
+ /**
+ * Returns the country with the primary key or returns null
if it could not be found.
+ *
+ * @param countryId the primary key of the country
+ * @return the country, or null
if a country with the primary key could not be found
+ */
+ public Country fetchByPrimaryKey(long countryId);
+
+ /**
+ * Returns all the countries.
+ *
+ * @return the countries
+ */
+ public java.util.List findAll();
+
+ /**
+ * Returns a range of all the countries.
+ *
+ *
+ * Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent, then the query will include the default ORDER BY logic from CountryModelImpl
.
+ *
+ *
+ * @param start the lower bound of the range of countries
+ * @param end the upper bound of the range of countries (not inclusive)
+ * @return the range of countries
+ */
+ public java.util.List findAll(int start, int end);
+
+ /**
+ * Returns an ordered range of all the countries.
+ *
+ *
+ * Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent, then the query will include the default ORDER BY logic from CountryModelImpl
.
+ *
+ *
+ * @param start the lower bound of the range of countries
+ * @param end the upper bound of the range of countries (not inclusive)
+ * @param orderByComparator the comparator to order the results by (optionally null
)
+ * @return the ordered range of countries
+ */
+ public java.util.List findAll(
+ int start, int end,
+ com.liferay.portal.kernel.util.OrderByComparator
+ orderByComparator);
+
+ /**
+ * Returns an ordered range of all the countries.
+ *
+ *
+ * Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent, then the query will include the default ORDER BY logic from CountryModelImpl
.
+ *
+ *
+ * @param start the lower bound of the range of countries
+ * @param end the upper bound of the range of countries (not inclusive)
+ * @param orderByComparator the comparator to order the results by (optionally null
)
+ * @param useFinderCache whether to use the finder cache
+ * @return the ordered range of countries
+ */
+ public java.util.List findAll(
+ int start, int end,
+ com.liferay.portal.kernel.util.OrderByComparator
+ orderByComparator,
+ boolean useFinderCache);
+
+ /**
+ * Removes all the countries from the database.
+ */
+ public void removeAll();
+
+ /**
+ * Returns the number of countries.
+ *
+ * @return the number of countries
+ */
+ public int countAll();
+
+}
\ No newline at end of file
diff --git a/liferay-workspace/apps/service-builder/dsp/dsp-api/src/main/java/com/liferay/blade/samples/dspservicebuilder/service/persistence/CountryUtil.java b/liferay-workspace/apps/service-builder/dsp/dsp-api/src/main/java/com/liferay/blade/samples/dspservicebuilder/service/persistence/CountryUtil.java
new file mode 100644
index 000000000..ce653383e
--- /dev/null
+++ b/liferay-workspace/apps/service-builder/dsp/dsp-api/src/main/java/com/liferay/blade/samples/dspservicebuilder/service/persistence/CountryUtil.java
@@ -0,0 +1,296 @@
+/**
+ * Copyright 2000-present Liferay, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.liferay.blade.samples.dspservicebuilder.service.persistence;
+
+import com.liferay.blade.samples.dspservicebuilder.model.Country;
+import com.liferay.portal.kernel.dao.orm.DynamicQuery;
+import com.liferay.portal.kernel.service.ServiceContext;
+import com.liferay.portal.kernel.util.OrderByComparator;
+
+import java.io.Serializable;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.util.tracker.ServiceTracker;
+
+/**
+ * The persistence utility for the country service. This utility wraps com.liferay.blade.samples.dspservicebuilder.service.persistence.impl.CountryPersistenceImpl
and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
+ *
+ *
+ * Caching information and settings can be found in portal.properties
+ *
+ *
+ * @author Brian Wing Shun Chan
+ * @see CountryPersistence
+ * @generated
+ */
+public class CountryUtil {
+
+ /*
+ * NOTE FOR DEVELOPERS:
+ *
+ * Never modify this class directly. Modify service.xml
and rerun ServiceBuilder to regenerate this class.
+ */
+
+ /**
+ * @see com.liferay.portal.kernel.service.persistence.BasePersistence#clearCache()
+ */
+ public static void clearCache() {
+ getPersistence().clearCache();
+ }
+
+ /**
+ * @see com.liferay.portal.kernel.service.persistence.BasePersistence#clearCache(com.liferay.portal.kernel.model.BaseModel)
+ */
+ public static void clearCache(Country country) {
+ getPersistence().clearCache(country);
+ }
+
+ /**
+ * @see com.liferay.portal.kernel.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
+ */
+ public static long countWithDynamicQuery(DynamicQuery dynamicQuery) {
+ return getPersistence().countWithDynamicQuery(dynamicQuery);
+ }
+
+ /**
+ * @see com.liferay.portal.kernel.service.persistence.BasePersistence#fetchByPrimaryKeys(Set)
+ */
+ public static Map fetchByPrimaryKeys(
+ Set primaryKeys) {
+
+ return getPersistence().fetchByPrimaryKeys(primaryKeys);
+ }
+
+ /**
+ * @see com.liferay.portal.kernel.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
+ */
+ public static List findWithDynamicQuery(
+ DynamicQuery dynamicQuery) {
+
+ return getPersistence().findWithDynamicQuery(dynamicQuery);
+ }
+
+ /**
+ * @see com.liferay.portal.kernel.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
+ */
+ public static List findWithDynamicQuery(
+ DynamicQuery dynamicQuery, int start, int end) {
+
+ return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
+ }
+
+ /**
+ * @see com.liferay.portal.kernel.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
+ */
+ public static List findWithDynamicQuery(
+ DynamicQuery dynamicQuery, int start, int end,
+ OrderByComparator orderByComparator) {
+
+ return getPersistence().findWithDynamicQuery(
+ dynamicQuery, start, end, orderByComparator);
+ }
+
+ /**
+ * @see com.liferay.portal.kernel.service.persistence.BasePersistence#update(com.liferay.portal.kernel.model.BaseModel)
+ */
+ public static Country update(Country country) {
+ return getPersistence().update(country);
+ }
+
+ /**
+ * @see com.liferay.portal.kernel.service.persistence.BasePersistence#update(com.liferay.portal.kernel.model.BaseModel, ServiceContext)
+ */
+ public static Country update(
+ Country country, ServiceContext serviceContext) {
+
+ return getPersistence().update(country, serviceContext);
+ }
+
+ /**
+ * Caches the country in the entity cache if it is enabled.
+ *
+ * @param country the country
+ */
+ public static void cacheResult(Country country) {
+ getPersistence().cacheResult(country);
+ }
+
+ /**
+ * Caches the countries in the entity cache if it is enabled.
+ *
+ * @param countries the countries
+ */
+ public static void cacheResult(List countries) {
+ getPersistence().cacheResult(countries);
+ }
+
+ /**
+ * Creates a new country with the primary key. Does not add the country to the database.
+ *
+ * @param countryId the primary key for the new country
+ * @return the new country
+ */
+ public static Country create(long countryId) {
+ return getPersistence().create(countryId);
+ }
+
+ /**
+ * Removes the country with the primary key from the database. Also notifies the appropriate model listeners.
+ *
+ * @param countryId the primary key of the country
+ * @return the country that was removed
+ * @throws NoSuchCountryException if a country with the primary key could not be found
+ */
+ public static Country remove(long countryId)
+ throws com.liferay.blade.samples.dspservicebuilder.exception.
+ NoSuchCountryException {
+
+ return getPersistence().remove(countryId);
+ }
+
+ public static Country updateImpl(Country country) {
+ return getPersistence().updateImpl(country);
+ }
+
+ /**
+ * Returns the country with the primary key or throws a NoSuchCountryException
if it could not be found.
+ *
+ * @param countryId the primary key of the country
+ * @return the country
+ * @throws NoSuchCountryException if a country with the primary key could not be found
+ */
+ public static Country findByPrimaryKey(long countryId)
+ throws com.liferay.blade.samples.dspservicebuilder.exception.
+ NoSuchCountryException {
+
+ return getPersistence().findByPrimaryKey(countryId);
+ }
+
+ /**
+ * Returns the country with the primary key or returns null
if it could not be found.
+ *
+ * @param countryId the primary key of the country
+ * @return the country, or null
if a country with the primary key could not be found
+ */
+ public static Country fetchByPrimaryKey(long countryId) {
+ return getPersistence().fetchByPrimaryKey(countryId);
+ }
+
+ /**
+ * Returns all the countries.
+ *
+ * @return the countries
+ */
+ public static List findAll() {
+ return getPersistence().findAll();
+ }
+
+ /**
+ * Returns a range of all the countries.
+ *
+ *
+ * Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent, then the query will include the default ORDER BY logic from CountryModelImpl
.
+ *
+ *
+ * @param start the lower bound of the range of countries
+ * @param end the upper bound of the range of countries (not inclusive)
+ * @return the range of countries
+ */
+ public static List findAll(int start, int end) {
+ return getPersistence().findAll(start, end);
+ }
+
+ /**
+ * Returns an ordered range of all the countries.
+ *
+ *
+ * Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent, then the query will include the default ORDER BY logic from CountryModelImpl
.
+ *
+ *
+ * @param start the lower bound of the range of countries
+ * @param end the upper bound of the range of countries (not inclusive)
+ * @param orderByComparator the comparator to order the results by (optionally null
)
+ * @return the ordered range of countries
+ */
+ public static List findAll(
+ int start, int end, OrderByComparator orderByComparator) {
+
+ return getPersistence().findAll(start, end, orderByComparator);
+ }
+
+ /**
+ * Returns an ordered range of all the countries.
+ *
+ *
+ * Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent, then the query will include the default ORDER BY logic from CountryModelImpl
.
+ *
+ *
+ * @param start the lower bound of the range of countries
+ * @param end the upper bound of the range of countries (not inclusive)
+ * @param orderByComparator the comparator to order the results by (optionally null
)
+ * @param useFinderCache whether to use the finder cache
+ * @return the ordered range of countries
+ */
+ public static List findAll(
+ int start, int end, OrderByComparator orderByComparator,
+ boolean useFinderCache) {
+
+ return getPersistence().findAll(
+ start, end, orderByComparator, useFinderCache);
+ }
+
+ /**
+ * Removes all the countries from the database.
+ */
+ public static void removeAll() {
+ getPersistence().removeAll();
+ }
+
+ /**
+ * Returns the number of countries.
+ *
+ * @return the number of countries
+ */
+ public static int countAll() {
+ return getPersistence().countAll();
+ }
+
+ public static CountryPersistence getPersistence() {
+ return _serviceTracker.getService();
+ }
+
+ private static ServiceTracker
+ _serviceTracker;
+
+ static {
+ Bundle bundle = FrameworkUtil.getBundle(CountryPersistence.class);
+
+ ServiceTracker serviceTracker =
+ new ServiceTracker(
+ bundle.getBundleContext(), CountryPersistence.class, null);
+
+ serviceTracker.open();
+
+ _serviceTracker = serviceTracker;
+ }
+
+}
\ No newline at end of file
diff --git a/liferay-workspace/apps/service-builder/dsp/dsp-service/bnd.bnd b/liferay-workspace/apps/service-builder/dsp/dsp-service/bnd.bnd
new file mode 100644
index 000000000..75de105de
--- /dev/null
+++ b/liferay-workspace/apps/service-builder/dsp/dsp-service/bnd.bnd
@@ -0,0 +1,6 @@
+Bundle-Name: dsp-service
+Bundle-SymbolicName: com.liferay.blade.samples.dspservicebuilder.service
+Bundle-Version: 1.0.0
+Liferay-Require-SchemaVersion: 1.0.0
+Liferay-Service: true
+-dsannotations-options: inherit
\ No newline at end of file
diff --git a/liferay-workspace/apps/service-builder/dsp/dsp-service/build.gradle b/liferay-workspace/apps/service-builder/dsp/dsp-service/build.gradle
new file mode 100644
index 000000000..1d014e0d5
--- /dev/null
+++ b/liferay-workspace/apps/service-builder/dsp/dsp-service/build.gradle
@@ -0,0 +1,17 @@
+dependencies {
+ compileOnly group: "com.liferay", name: "com.liferay.petra.io"
+ compileOnly group: "com.liferay", name: "com.liferay.petra.lang"
+ compileOnly group: "com.liferay", name: "com.liferay.petra.string"
+ compileOnly group: "com.liferay", name: "com.liferay.portal.aop.api"
+ compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel"
+ compileOnly group: "org.osgi", name: "org.osgi.annotation.versioning"
+ compileOnly group: "org.osgi", name: "org.osgi.core"
+ compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations"
+ compileOnly project(":apps:service-builder:dsp:dsp-api")
+}
+
+buildService {
+ apiDir = "../dsp-api/src/main/java"
+}
+
+group = "com.liferay.blade.samples.dspservicebuilder"
\ No newline at end of file
diff --git a/liferay-workspace/apps/service-builder/dsp/dsp-service/service.xml b/liferay-workspace/apps/service-builder/dsp/dsp-service/service.xml
new file mode 100644
index 000000000..c0d79bb4e
--- /dev/null
+++ b/liferay-workspace/apps/service-builder/dsp/dsp-service/service.xml
@@ -0,0 +1,16 @@
+
+
+
+
+ DSPCOUNTRY
+
+
+
+
+
\ No newline at end of file
diff --git a/maven/apps/npm/angular-npm-portlet/src/main/resources/META-INF/resources/init.jsp b/liferay-workspace/apps/service-builder/dsp/dsp-service/src/main/java/com/liferay/blade/samples/dspservicebuilder/internal/DataSourceProviderImpl.java
similarity index 51%
rename from maven/apps/npm/angular-npm-portlet/src/main/resources/META-INF/resources/init.jsp
rename to liferay-workspace/apps/service-builder/dsp/dsp-service/src/main/java/com/liferay/blade/samples/dspservicebuilder/internal/DataSourceProviderImpl.java
index dc26f9f66..7cccf60a6 100644
--- a/maven/apps/npm/angular-npm-portlet/src/main/resources/META-INF/resources/init.jsp
+++ b/liferay-workspace/apps/service-builder/dsp/dsp-service/src/main/java/com/liferay/blade/samples/dspservicebuilder/internal/DataSourceProviderImpl.java
@@ -1,4 +1,3 @@
-<%--
/**
* Copyright 2000-present Liferay, Inc.
*
@@ -14,21 +13,29 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
---%>
-<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+package com.liferay.blade.samples.dspservicebuilder.internal;
-<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
+import com.liferay.portal.kernel.dao.jdbc.DataSourceFactoryUtil;
+import com.liferay.portal.kernel.dao.jdbc.DataSourceProvider;
+import com.liferay.portal.kernel.util.PropsUtil;
-<%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %><%@
-taglib uri="http://liferay.com/tld/portlet" prefix="liferay-portlet" %><%@
-taglib uri="http://liferay.com/tld/theme" prefix="liferay-theme" %><%@
-taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %>
+import javax.sql.DataSource;
-
+/**
+ * @author Liferay
+ */
+public class DataSourceProviderImpl implements DataSourceProvider {
-
+ @Override
+ public DataSource getDataSource() {
+ try {
+ return DataSourceFactoryUtil.initDataSource(
+ PropsUtil.getProperties("jdbc.ext.", true));
+ }
+ catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
-<%
-String mainRequire = (String)renderRequest.getAttribute("mainRequire");
-%>
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/liferay-workspace/apps/service-builder/dsp/dsp-service/src/main/java/com/liferay/blade/samples/dspservicebuilder/model/impl/CountryBaseImpl.java b/liferay-workspace/apps/service-builder/dsp/dsp-service/src/main/java/com/liferay/blade/samples/dspservicebuilder/model/impl/CountryBaseImpl.java
new file mode 100644
index 000000000..529313c62
--- /dev/null
+++ b/liferay-workspace/apps/service-builder/dsp/dsp-service/src/main/java/com/liferay/blade/samples/dspservicebuilder/model/impl/CountryBaseImpl.java
@@ -0,0 +1,52 @@
+/**
+ * Copyright 2000-present Liferay, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.liferay.blade.samples.dspservicebuilder.model.impl;
+
+import com.liferay.blade.samples.dspservicebuilder.model.Country;
+import com.liferay.blade.samples.dspservicebuilder.service.CountryLocalServiceUtil;
+
+/**
+ * The extended model base implementation for the Country service. Represents a row in the "country" database table, with each column mapped to a property of this class.
+ *
+ *
+ * This class exists only as a container for the default extended model level methods generated by ServiceBuilder. Helper methods and all application logic should be put in {@link CountryImpl}.
+ *
+ *
+ * @author Brian Wing Shun Chan
+ * @see CountryImpl
+ * @see Country
+ * @generated
+ */
+public abstract class CountryBaseImpl
+ extends CountryModelImpl implements Country {
+
+ /*
+ * NOTE FOR DEVELOPERS:
+ *
+ * Never modify or reference this class directly. All methods that expect a country model instance should use the Country
interface instead.
+ */
+ @Override
+ public void persist() {
+ if (this.isNew()) {
+ CountryLocalServiceUtil.addCountry(this);
+ }
+ else {
+ CountryLocalServiceUtil.updateCountry(this);
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/liferay-workspace/apps/service-builder/dsp/dsp-service/src/main/java/com/liferay/blade/samples/dspservicebuilder/model/impl/CountryCacheModel.java b/liferay-workspace/apps/service-builder/dsp/dsp-service/src/main/java/com/liferay/blade/samples/dspservicebuilder/model/impl/CountryCacheModel.java
new file mode 100644
index 000000000..23b0b7a84
--- /dev/null
+++ b/liferay-workspace/apps/service-builder/dsp/dsp-service/src/main/java/com/liferay/blade/samples/dspservicebuilder/model/impl/CountryCacheModel.java
@@ -0,0 +1,113 @@
+/**
+ * Copyright 2000-present Liferay, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.liferay.blade.samples.dspservicebuilder.model.impl;
+
+import com.liferay.blade.samples.dspservicebuilder.model.Country;
+import com.liferay.petra.lang.HashUtil;
+import com.liferay.petra.string.StringBundler;
+import com.liferay.portal.kernel.model.CacheModel;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+/**
+ * The cache model class for representing Country in entity cache.
+ *
+ * @author Brian Wing Shun Chan
+ * @generated
+ */
+public class CountryCacheModel implements CacheModel, Externalizable {
+
+ @Override
+ public boolean equals(Object object) {
+ if (this == object) {
+ return true;
+ }
+
+ if (!(object instanceof CountryCacheModel)) {
+ return false;
+ }
+
+ CountryCacheModel countryCacheModel = (CountryCacheModel)object;
+
+ if (countryId == countryCacheModel.countryId) {
+ return true;
+ }
+
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ return HashUtil.hash(0, countryId);
+ }
+
+ @Override
+ public String toString() {
+ StringBundler sb = new StringBundler(5);
+
+ sb.append("{countryId=");
+ sb.append(countryId);
+ sb.append(", countryName=");
+ sb.append(countryName);
+ sb.append("}");
+
+ return sb.toString();
+ }
+
+ @Override
+ public Country toEntityModel() {
+ CountryImpl countryImpl = new CountryImpl();
+
+ countryImpl.setCountryId(countryId);
+
+ if (countryName == null) {
+ countryImpl.setCountryName("");
+ }
+ else {
+ countryImpl.setCountryName(countryName);
+ }
+
+ countryImpl.resetOriginalValues();
+
+ return countryImpl;
+ }
+
+ @Override
+ public void readExternal(ObjectInput objectInput) throws IOException {
+ countryId = objectInput.readLong();
+ countryName = objectInput.readUTF();
+ }
+
+ @Override
+ public void writeExternal(ObjectOutput objectOutput) throws IOException {
+ objectOutput.writeLong(countryId);
+
+ if (countryName == null) {
+ objectOutput.writeUTF("");
+ }
+ else {
+ objectOutput.writeUTF(countryName);
+ }
+ }
+
+ public long countryId;
+ public String countryName;
+
+}
\ No newline at end of file
diff --git a/liferay-workspace/apps/service-builder/dsp/dsp-service/src/main/java/com/liferay/blade/samples/dspservicebuilder/model/impl/CountryImpl.java b/liferay-workspace/apps/service-builder/dsp/dsp-service/src/main/java/com/liferay/blade/samples/dspservicebuilder/model/impl/CountryImpl.java
new file mode 100644
index 000000000..7de41f47f
--- /dev/null
+++ b/liferay-workspace/apps/service-builder/dsp/dsp-service/src/main/java/com/liferay/blade/samples/dspservicebuilder/model/impl/CountryImpl.java
@@ -0,0 +1,38 @@
+/**
+ * Copyright 2000-present Liferay, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.liferay.blade.samples.dspservicebuilder.model.impl;
+
+/**
+ * The extended model implementation for the Country service. Represents a row in the "country" database table, with each column mapped to a property of this class.
+ *
+ *
+ * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy their definitions into the com.liferay.blade.samples.dspservicebuilder.model.Country
interface.
+ *
+ *
+ * @author Brian Wing Shun Chan
+ */
+public class CountryImpl extends CountryBaseImpl {
+
+ /**
+ * NOTE FOR DEVELOPERS:
+ *
+ * Never reference this class directly. All methods that expect a country model instance should use the {@link com.liferay.blade.samples.dspservicebuilder.model.Country} interface instead.
+ */
+ public CountryImpl() {
+ }
+
+}
\ No newline at end of file
diff --git a/liferay-workspace/apps/service-builder/dsp/dsp-service/src/main/java/com/liferay/blade/samples/dspservicebuilder/model/impl/CountryModelImpl.java b/liferay-workspace/apps/service-builder/dsp/dsp-service/src/main/java/com/liferay/blade/samples/dspservicebuilder/model/impl/CountryModelImpl.java
new file mode 100644
index 000000000..1d03ed663
--- /dev/null
+++ b/liferay-workspace/apps/service-builder/dsp/dsp-service/src/main/java/com/liferay/blade/samples/dspservicebuilder/model/impl/CountryModelImpl.java
@@ -0,0 +1,456 @@
+/**
+ * Copyright 2000-present Liferay, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.liferay.blade.samples.dspservicebuilder.model.impl;
+
+import com.liferay.blade.samples.dspservicebuilder.model.Country;
+import com.liferay.blade.samples.dspservicebuilder.model.CountryModel;
+import com.liferay.expando.kernel.model.ExpandoBridge;
+import com.liferay.expando.kernel.util.ExpandoBridgeFactoryUtil;
+import com.liferay.petra.string.StringBundler;
+import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
+import com.liferay.portal.kernel.model.CacheModel;
+import com.liferay.portal.kernel.model.ModelWrapper;
+import com.liferay.portal.kernel.model.impl.BaseModelImpl;
+import com.liferay.portal.kernel.service.ServiceContext;
+import com.liferay.portal.kernel.util.ProxyUtil;
+
+import java.io.Serializable;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationHandler;
+
+import java.sql.Types;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.function.BiConsumer;
+import java.util.function.Function;
+
+/**
+ * The base model implementation for the Country service. Represents a row in the "country" database table, with each column mapped to a property of this class.
+ *
+ *
+ * This implementation and its corresponding interface CountryModel
exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link CountryImpl}.
+ *
+ *
+ * @author Brian Wing Shun Chan
+ * @see CountryImpl
+ * @generated
+ */
+public class CountryModelImpl
+ extends BaseModelImpl implements CountryModel {
+
+ /*
+ * NOTE FOR DEVELOPERS:
+ *
+ * Never modify or reference this class directly. All methods that expect a country model instance should use the Country
interface instead.
+ */
+ public static final String TABLE_NAME = "country";
+
+ public static final Object[][] TABLE_COLUMNS = {
+ {"id", Types.BIGINT}, {"name", Types.VARCHAR}
+ };
+
+ public static final Map TABLE_COLUMNS_MAP =
+ new HashMap();
+
+ static {
+ TABLE_COLUMNS_MAP.put("id", Types.BIGINT);
+ TABLE_COLUMNS_MAP.put("name", Types.VARCHAR);
+ }
+
+ public static final String TABLE_SQL_CREATE =
+ "create table country (id LONG not null primary key,name VARCHAR(75) null)";
+
+ public static final String TABLE_SQL_DROP = "drop table country";
+
+ public static final String ORDER_BY_JPQL =
+ " ORDER BY country.countryId ASC";
+
+ public static final String ORDER_BY_SQL = " ORDER BY country.id ASC";
+
+ public static final String DATA_SOURCE = "liferayDataSource";
+
+ public static final String SESSION_FACTORY = "liferaySessionFactory";
+
+ public static final String TX_MANAGER = "liferayTransactionManager";
+
+ public static void setEntityCacheEnabled(boolean entityCacheEnabled) {
+ _entityCacheEnabled = entityCacheEnabled;
+ }
+
+ public static void setFinderCacheEnabled(boolean finderCacheEnabled) {
+ _finderCacheEnabled = finderCacheEnabled;
+ }
+
+ public CountryModelImpl() {
+ }
+
+ @Override
+ public long getPrimaryKey() {
+ return _countryId;
+ }
+
+ @Override
+ public void setPrimaryKey(long primaryKey) {
+ setCountryId(primaryKey);
+ }
+
+ @Override
+ public Serializable getPrimaryKeyObj() {
+ return _countryId;
+ }
+
+ @Override
+ public void setPrimaryKeyObj(Serializable primaryKeyObj) {
+ setPrimaryKey(((Long)primaryKeyObj).longValue());
+ }
+
+ @Override
+ public Class> getModelClass() {
+ return Country.class;
+ }
+
+ @Override
+ public String getModelClassName() {
+ return Country.class.getName();
+ }
+
+ @Override
+ public Map getModelAttributes() {
+ Map attributes = new HashMap();
+
+ Map> attributeGetterFunctions =
+ getAttributeGetterFunctions();
+
+ for (Map.Entry> entry :
+ attributeGetterFunctions.entrySet()) {
+
+ String attributeName = entry.getKey();
+ Function attributeGetterFunction =
+ entry.getValue();
+
+ attributes.put(
+ attributeName, attributeGetterFunction.apply((Country)this));
+ }
+
+ attributes.put("entityCacheEnabled", isEntityCacheEnabled());
+ attributes.put("finderCacheEnabled", isFinderCacheEnabled());
+
+ return attributes;
+ }
+
+ @Override
+ public void setModelAttributes(Map attributes) {
+ Map> attributeSetterBiConsumers =
+ getAttributeSetterBiConsumers();
+
+ for (Map.Entry entry : attributes.entrySet()) {
+ String attributeName = entry.getKey();
+
+ BiConsumer attributeSetterBiConsumer =
+ attributeSetterBiConsumers.get(attributeName);
+
+ if (attributeSetterBiConsumer != null) {
+ attributeSetterBiConsumer.accept(
+ (Country)this, entry.getValue());
+ }
+ }
+ }
+
+ public Map>
+ getAttributeGetterFunctions() {
+
+ return _attributeGetterFunctions;
+ }
+
+ public Map>
+ getAttributeSetterBiConsumers() {
+
+ return _attributeSetterBiConsumers;
+ }
+
+ private static Function
+ _getProxyProviderFunction() {
+
+ Class> proxyClass = ProxyUtil.getProxyClass(
+ Country.class.getClassLoader(), Country.class, ModelWrapper.class);
+
+ try {
+ Constructor constructor =
+ (Constructor)proxyClass.getConstructor(
+ InvocationHandler.class);
+
+ return invocationHandler -> {
+ try {
+ return constructor.newInstance(invocationHandler);
+ }
+ catch (ReflectiveOperationException
+ reflectiveOperationException) {
+
+ throw new InternalError(reflectiveOperationException);
+ }
+ };
+ }
+ catch (NoSuchMethodException noSuchMethodException) {
+ throw new InternalError(noSuchMethodException);
+ }
+ }
+
+ private static final Map>
+ _attributeGetterFunctions;
+ private static final Map>
+ _attributeSetterBiConsumers;
+
+ static {
+ Map> attributeGetterFunctions =
+ new LinkedHashMap>();
+ Map> attributeSetterBiConsumers =
+ new LinkedHashMap>();
+
+ attributeGetterFunctions.put("countryId", Country::getCountryId);
+ attributeSetterBiConsumers.put(
+ "countryId", (BiConsumer)Country::setCountryId);
+ attributeGetterFunctions.put("countryName", Country::getCountryName);
+ attributeSetterBiConsumers.put(
+ "countryName",
+ (BiConsumer)Country::setCountryName);
+
+ _attributeGetterFunctions = Collections.unmodifiableMap(
+ attributeGetterFunctions);
+ _attributeSetterBiConsumers = Collections.unmodifiableMap(
+ (Map)attributeSetterBiConsumers);
+ }
+
+ @Override
+ public long getCountryId() {
+ return _countryId;
+ }
+
+ @Override
+ public void setCountryId(long countryId) {
+ _countryId = countryId;
+ }
+
+ @Override
+ public String getCountryName() {
+ if (_countryName == null) {
+ return "";
+ }
+ else {
+ return _countryName;
+ }
+ }
+
+ @Override
+ public void setCountryName(String countryName) {
+ _countryName = countryName;
+ }
+
+ @Override
+ public ExpandoBridge getExpandoBridge() {
+ return ExpandoBridgeFactoryUtil.getExpandoBridge(
+ 0, Country.class.getName(), getPrimaryKey());
+ }
+
+ @Override
+ public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
+ ExpandoBridge expandoBridge = getExpandoBridge();
+
+ expandoBridge.setAttributes(serviceContext);
+ }
+
+ @Override
+ public Country toEscapedModel() {
+ if (_escapedModel == null) {
+ Function
+ escapedModelProxyProviderFunction =
+ EscapedModelProxyProviderFunctionHolder.
+ _escapedModelProxyProviderFunction;
+
+ _escapedModel = escapedModelProxyProviderFunction.apply(
+ new AutoEscapeBeanHandler(this));
+ }
+
+ return _escapedModel;
+ }
+
+ @Override
+ public Object clone() {
+ CountryImpl countryImpl = new CountryImpl();
+
+ countryImpl.setCountryId(getCountryId());
+ countryImpl.setCountryName(getCountryName());
+
+ countryImpl.resetOriginalValues();
+
+ return countryImpl;
+ }
+
+ @Override
+ public int compareTo(Country country) {
+ long primaryKey = country.getPrimaryKey();
+
+ if (getPrimaryKey() < primaryKey) {
+ return -1;
+ }
+ else if (getPrimaryKey() > primaryKey) {
+ return 1;
+ }
+ else {
+ return 0;
+ }
+ }
+
+ @Override
+ public boolean equals(Object object) {
+ if (this == object) {
+ return true;
+ }
+
+ if (!(object instanceof Country)) {
+ return false;
+ }
+
+ Country country = (Country)object;
+
+ long primaryKey = country.getPrimaryKey();
+
+ if (getPrimaryKey() == primaryKey) {
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+
+ @Override
+ public int hashCode() {
+ return (int)getPrimaryKey();
+ }
+
+ @Override
+ public boolean isEntityCacheEnabled() {
+ return _entityCacheEnabled;
+ }
+
+ @Override
+ public boolean isFinderCacheEnabled() {
+ return _finderCacheEnabled;
+ }
+
+ @Override
+ public void resetOriginalValues() {
+ }
+
+ @Override
+ public CacheModel toCacheModel() {
+ CountryCacheModel countryCacheModel = new CountryCacheModel();
+
+ countryCacheModel.countryId = getCountryId();
+
+ countryCacheModel.countryName = getCountryName();
+
+ String countryName = countryCacheModel.countryName;
+
+ if ((countryName != null) && (countryName.length() == 0)) {
+ countryCacheModel.countryName = null;
+ }
+
+ return countryCacheModel;
+ }
+
+ @Override
+ public String toString() {
+ Map> attributeGetterFunctions =
+ getAttributeGetterFunctions();
+
+ StringBundler sb = new StringBundler(
+ 4 * attributeGetterFunctions.size() + 2);
+
+ sb.append("{");
+
+ for (Map.Entry> entry :
+ attributeGetterFunctions.entrySet()) {
+
+ String attributeName = entry.getKey();
+ Function attributeGetterFunction =
+ entry.getValue();
+
+ sb.append(attributeName);
+ sb.append("=");
+ sb.append(attributeGetterFunction.apply((Country)this));
+ sb.append(", ");
+ }
+
+ if (sb.index() > 1) {
+ sb.setIndex(sb.index() - 1);
+ }
+
+ sb.append("}");
+
+ return sb.toString();
+ }
+
+ @Override
+ public String toXmlString() {
+ Map> attributeGetterFunctions =
+ getAttributeGetterFunctions();
+
+ StringBundler sb = new StringBundler(
+ 5 * attributeGetterFunctions.size() + 4);
+
+ sb.append("");
+ sb.append(getModelClassName());
+ sb.append("");
+
+ for (Map.Entry> entry :
+ attributeGetterFunctions.entrySet()) {
+
+ String attributeName = entry.getKey();
+ Function attributeGetterFunction =
+ entry.getValue();
+
+ sb.append("");
+ sb.append(attributeName);
+ sb.append("");
+ }
+
+ sb.append("");
+
+ return sb.toString();
+ }
+
+ private static class EscapedModelProxyProviderFunctionHolder {
+
+ private static final Function
+ _escapedModelProxyProviderFunction = _getProxyProviderFunction();
+
+ }
+
+ private static boolean _entityCacheEnabled;
+ private static boolean _finderCacheEnabled;
+
+ private long _countryId;
+ private String _countryName;
+ private Country _escapedModel;
+
+}
\ No newline at end of file
diff --git a/liferay-workspace/apps/service-builder/dsp/dsp-service/src/main/java/com/liferay/blade/samples/dspservicebuilder/service/base/CountryLocalServiceBaseImpl.java b/liferay-workspace/apps/service-builder/dsp/dsp-service/src/main/java/com/liferay/blade/samples/dspservicebuilder/service/base/CountryLocalServiceBaseImpl.java
new file mode 100644
index 000000000..dd8823f72
--- /dev/null
+++ b/liferay-workspace/apps/service-builder/dsp/dsp-service/src/main/java/com/liferay/blade/samples/dspservicebuilder/service/base/CountryLocalServiceBaseImpl.java
@@ -0,0 +1,409 @@
+/**
+ * Copyright 2000-present Liferay, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.liferay.blade.samples.dspservicebuilder.service.base;
+
+import com.liferay.blade.samples.dspservicebuilder.model.Country;
+import com.liferay.blade.samples.dspservicebuilder.service.CountryLocalService;
+import com.liferay.blade.samples.dspservicebuilder.service.persistence.CountryPersistence;
+import com.liferay.portal.aop.AopService;
+import com.liferay.portal.kernel.dao.db.DB;
+import com.liferay.portal.kernel.dao.db.DBManagerUtil;
+import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
+import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
+import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
+import com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery;
+import com.liferay.portal.kernel.dao.orm.DynamicQuery;
+import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
+import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
+import com.liferay.portal.kernel.dao.orm.Projection;
+import com.liferay.portal.kernel.exception.PortalException;
+import com.liferay.portal.kernel.exception.SystemException;
+import com.liferay.portal.kernel.model.PersistedModel;
+import com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService;
+import com.liferay.portal.kernel.search.Indexable;
+import com.liferay.portal.kernel.search.IndexableType;
+import com.liferay.portal.kernel.service.BaseLocalServiceImpl;
+import com.liferay.portal.kernel.service.PersistedModelLocalService;
+import com.liferay.portal.kernel.service.persistence.BasePersistence;
+import com.liferay.portal.kernel.transaction.Transactional;
+import com.liferay.portal.kernel.util.OrderByComparator;
+import com.liferay.portal.kernel.util.PortalUtil;
+
+import java.io.Serializable;
+
+import java.util.List;
+
+import javax.sql.DataSource;
+
+import org.osgi.service.component.annotations.Reference;
+
+/**
+ * Provides the base implementation for the country local service.
+ *
+ *
+ * This implementation exists only as a container for the default service methods generated by ServiceBuilder. All custom service methods should be put in {@link com.liferay.blade.samples.dspservicebuilder.service.impl.CountryLocalServiceImpl}.
+ *
+ *
+ * @author Brian Wing Shun Chan
+ * @see com.liferay.blade.samples.dspservicebuilder.service.impl.CountryLocalServiceImpl
+ * @generated
+ */
+public abstract class CountryLocalServiceBaseImpl
+ extends BaseLocalServiceImpl
+ implements AopService, CountryLocalService, IdentifiableOSGiService {
+
+ /*
+ * NOTE FOR DEVELOPERS:
+ *
+ * Never modify or reference this class directly. Use CountryLocalService
via injection or a org.osgi.util.tracker.ServiceTracker
or use com.liferay.blade.samples.dspservicebuilder.service.CountryLocalServiceUtil
.
+ */
+
+ /**
+ * Adds the country to the database. Also notifies the appropriate model listeners.
+ *
+ * @param country the country
+ * @return the country that was added
+ */
+ @Indexable(type = IndexableType.REINDEX)
+ @Override
+ public Country addCountry(Country country) {
+ country.setNew(true);
+
+ return countryPersistence.update(country);
+ }
+
+ /**
+ * Creates a new country with the primary key. Does not add the country to the database.
+ *
+ * @param countryId the primary key for the new country
+ * @return the new country
+ */
+ @Override
+ @Transactional(enabled = false)
+ public Country createCountry(long countryId) {
+ return countryPersistence.create(countryId);
+ }
+
+ /**
+ * Deletes the country with the primary key from the database. Also notifies the appropriate model listeners.
+ *
+ * @param countryId the primary key of the country
+ * @return the country that was removed
+ * @throws PortalException if a country with the primary key could not be found
+ */
+ @Indexable(type = IndexableType.DELETE)
+ @Override
+ public Country deleteCountry(long countryId) throws PortalException {
+ return countryPersistence.remove(countryId);
+ }
+
+ /**
+ * Deletes the country from the database. Also notifies the appropriate model listeners.
+ *
+ * @param country the country
+ * @return the country that was removed
+ */
+ @Indexable(type = IndexableType.DELETE)
+ @Override
+ public Country deleteCountry(Country country) {
+ return countryPersistence.remove(country);
+ }
+
+ @Override
+ public DynamicQuery dynamicQuery() {
+ Class> clazz = getClass();
+
+ return DynamicQueryFactoryUtil.forClass(
+ Country.class, clazz.getClassLoader());
+ }
+
+ /**
+ * Performs a dynamic query on the database and returns the matching rows.
+ *
+ * @param dynamicQuery the dynamic query
+ * @return the matching rows
+ */
+ @Override
+ public List dynamicQuery(DynamicQuery dynamicQuery) {
+ return countryPersistence.findWithDynamicQuery(dynamicQuery);
+ }
+
+ /**
+ * Performs a dynamic query on the database and returns a range of the matching rows.
+ *
+ *
+ * Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent, then the query will include the default ORDER BY logic from com.liferay.blade.samples.dspservicebuilder.model.impl.CountryModelImpl
.
+ *
+ *
+ * @param dynamicQuery the dynamic query
+ * @param start the lower bound of the range of model instances
+ * @param end the upper bound of the range of model instances (not inclusive)
+ * @return the range of matching rows
+ */
+ @Override
+ public List dynamicQuery(
+ DynamicQuery dynamicQuery, int start, int end) {
+
+ return countryPersistence.findWithDynamicQuery(
+ dynamicQuery, start, end);
+ }
+
+ /**
+ * Performs a dynamic query on the database and returns an ordered range of the matching rows.
+ *
+ *
+ * Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent, then the query will include the default ORDER BY logic from com.liferay.blade.samples.dspservicebuilder.model.impl.CountryModelImpl
.
+ *
+ *
+ * @param dynamicQuery the dynamic query
+ * @param start the lower bound of the range of model instances
+ * @param end the upper bound of the range of model instances (not inclusive)
+ * @param orderByComparator the comparator to order the results by (optionally null
)
+ * @return the ordered range of matching rows
+ */
+ @Override
+ public List dynamicQuery(
+ DynamicQuery dynamicQuery, int start, int end,
+ OrderByComparator orderByComparator) {
+
+ return countryPersistence.findWithDynamicQuery(
+ dynamicQuery, start, end, orderByComparator);
+ }
+
+ /**
+ * Returns the number of rows matching the dynamic query.
+ *
+ * @param dynamicQuery the dynamic query
+ * @return the number of rows matching the dynamic query
+ */
+ @Override
+ public long dynamicQueryCount(DynamicQuery dynamicQuery) {
+ return countryPersistence.countWithDynamicQuery(dynamicQuery);
+ }
+
+ /**
+ * Returns the number of rows matching the dynamic query.
+ *
+ * @param dynamicQuery the dynamic query
+ * @param projection the projection to apply to the query
+ * @return the number of rows matching the dynamic query
+ */
+ @Override
+ public long dynamicQueryCount(
+ DynamicQuery dynamicQuery, Projection projection) {
+
+ return countryPersistence.countWithDynamicQuery(
+ dynamicQuery, projection);
+ }
+
+ @Override
+ public Country fetchCountry(long countryId) {
+ return countryPersistence.fetchByPrimaryKey(countryId);
+ }
+
+ /**
+ * Returns the country with the primary key.
+ *
+ * @param countryId the primary key of the country
+ * @return the country
+ * @throws PortalException if a country with the primary key could not be found
+ */
+ @Override
+ public Country getCountry(long countryId) throws PortalException {
+ return countryPersistence.findByPrimaryKey(countryId);
+ }
+
+ @Override
+ public ActionableDynamicQuery getActionableDynamicQuery() {
+ ActionableDynamicQuery actionableDynamicQuery =
+ new DefaultActionableDynamicQuery();
+
+ actionableDynamicQuery.setBaseLocalService(countryLocalService);
+ actionableDynamicQuery.setClassLoader(getClassLoader());
+ actionableDynamicQuery.setModelClass(Country.class);
+
+ actionableDynamicQuery.setPrimaryKeyPropertyName("countryId");
+
+ return actionableDynamicQuery;
+ }
+
+ @Override
+ public IndexableActionableDynamicQuery
+ getIndexableActionableDynamicQuery() {
+
+ IndexableActionableDynamicQuery indexableActionableDynamicQuery =
+ new IndexableActionableDynamicQuery();
+
+ indexableActionableDynamicQuery.setBaseLocalService(
+ countryLocalService);
+ indexableActionableDynamicQuery.setClassLoader(getClassLoader());
+ indexableActionableDynamicQuery.setModelClass(Country.class);
+
+ indexableActionableDynamicQuery.setPrimaryKeyPropertyName("countryId");
+
+ return indexableActionableDynamicQuery;
+ }
+
+ protected void initActionableDynamicQuery(
+ ActionableDynamicQuery actionableDynamicQuery) {
+
+ actionableDynamicQuery.setBaseLocalService(countryLocalService);
+ actionableDynamicQuery.setClassLoader(getClassLoader());
+ actionableDynamicQuery.setModelClass(Country.class);
+
+ actionableDynamicQuery.setPrimaryKeyPropertyName("countryId");
+ }
+
+ /**
+ * @throws PortalException
+ */
+ @Override
+ public PersistedModel deletePersistedModel(PersistedModel persistedModel)
+ throws PortalException {
+
+ return countryLocalService.deleteCountry((Country)persistedModel);
+ }
+
+ public BasePersistence getBasePersistence() {
+ return countryPersistence;
+ }
+
+ /**
+ * @throws PortalException
+ */
+ @Override
+ public PersistedModel getPersistedModel(Serializable primaryKeyObj)
+ throws PortalException {
+
+ return countryPersistence.findByPrimaryKey(primaryKeyObj);
+ }
+
+ /**
+ * Returns a range of all the countries.
+ *
+ *
+ * Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent, then the query will include the default ORDER BY logic from com.liferay.blade.samples.dspservicebuilder.model.impl.CountryModelImpl
.
+ *
+ *
+ * @param start the lower bound of the range of countries
+ * @param end the upper bound of the range of countries (not inclusive)
+ * @return the range of countries
+ */
+ @Override
+ public List getCountries(int start, int end) {
+ return countryPersistence.findAll(start, end);
+ }
+
+ /**
+ * Returns the number of countries.
+ *
+ * @return the number of countries
+ */
+ @Override
+ public int getCountriesCount() {
+ return countryPersistence.countAll();
+ }
+
+ /**
+ * Updates the country in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
+ *
+ * @param country the country
+ * @return the country that was updated
+ */
+ @Indexable(type = IndexableType.REINDEX)
+ @Override
+ public Country updateCountry(Country country) {
+ return countryPersistence.update(country);
+ }
+
+ @Override
+ public Class>[] getAopInterfaces() {
+ return new Class>[] {
+ CountryLocalService.class, IdentifiableOSGiService.class,
+ PersistedModelLocalService.class
+ };
+ }
+
+ @Override
+ public void setAopProxy(Object aopProxy) {
+ countryLocalService = (CountryLocalService)aopProxy;
+ }
+
+ /**
+ * Returns the OSGi service identifier.
+ *
+ * @return the OSGi service identifier
+ */
+ @Override
+ public String getOSGiServiceIdentifier() {
+ return CountryLocalService.class.getName();
+ }
+
+ protected Class> getModelClass() {
+ return Country.class;
+ }
+
+ protected String getModelClassName() {
+ return Country.class.getName();
+ }
+
+ /**
+ * Performs a SQL query.
+ *
+ * @param sql the sql query
+ */
+ protected void runSQL(String sql) {
+ try {
+ DataSource dataSource = countryPersistence.getDataSource();
+
+ DB db = DBManagerUtil.getDB();
+
+ sql = db.buildSQL(sql);
+ sql = PortalUtil.transformSQL(sql);
+
+ SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(
+ dataSource, sql);
+
+ sqlUpdate.update();
+ }
+ catch (Exception exception) {
+ throw new SystemException(exception);
+ }
+ }
+
+ protected CountryLocalService countryLocalService;
+
+ @Reference
+ protected CountryPersistence countryPersistence;
+
+ @Reference
+ protected com.liferay.counter.kernel.service.CounterLocalService
+ counterLocalService;
+
+ @Reference
+ protected com.liferay.portal.kernel.service.ClassNameLocalService
+ classNameLocalService;
+
+ @Reference
+ protected com.liferay.portal.kernel.service.ResourceLocalService
+ resourceLocalService;
+
+ @Reference
+ protected com.liferay.portal.kernel.service.UserLocalService
+ userLocalService;
+
+}
\ No newline at end of file
diff --git a/liferay-workspace/apps/service-builder/dsp/dsp-service/src/main/java/com/liferay/blade/samples/dspservicebuilder/service/impl/CountryLocalServiceImpl.java b/liferay-workspace/apps/service-builder/dsp/dsp-service/src/main/java/com/liferay/blade/samples/dspservicebuilder/service/impl/CountryLocalServiceImpl.java
new file mode 100644
index 000000000..a237791a5
--- /dev/null
+++ b/liferay-workspace/apps/service-builder/dsp/dsp-service/src/main/java/com/liferay/blade/samples/dspservicebuilder/service/impl/CountryLocalServiceImpl.java
@@ -0,0 +1,94 @@
+/**
+ * Copyright 2000-present Liferay, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.liferay.blade.samples.dspservicebuilder.service.impl;
+
+import com.liferay.blade.samples.dspservicebuilder.service.base.CountryLocalServiceBaseImpl;
+import com.liferay.portal.aop.AopService;
+import com.liferay.portal.kernel.log.Log;
+import com.liferay.portal.kernel.log.LogFactoryUtil;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+import javax.sql.DataSource;
+
+import org.osgi.service.component.annotations.Component;
+
+/**
+ * The implementation of the country local service.
+ *
+ *
+ * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy their definitions into the com.liferay.blade.samples.dspservicebuilder.service.CountryLocalService
interface.
+ *
+ *
+ * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
+ *
+ *
+ * @author Brian Wing Shun Chan
+ * @see CountryLocalServiceBaseImpl
+ */
+@Component(
+ property = "model.class.name=com.liferay.blade.samples.dspservicebuilder.model.Country",
+ service = AopService.class
+)
+public class CountryLocalServiceImpl extends CountryLocalServiceBaseImpl {
+
+ /**
+ * NOTE FOR DEVELOPERS:
+ *
+ * Never reference this class directly. Use com.liferay.blade.samples.dspservicebuilder.service.CountryLocalService
via injection or a org.osgi.util.tracker.ServiceTracker
or use com.liferay.blade.samples.dspservicebuilder.service.CountryLocalServiceUtil
.
+ */
+ public void useDSP() {
+ try {
+ DataSource dataSource = countryPersistence.getDataSource();
+
+ Connection connection = dataSource.getConnection();
+
+ Statement statement = connection.createStatement();
+
+ ResultSet resultSet = statement.executeQuery(
+ "select id, name from country");
+
+ while (resultSet.next()) {
+ if (_log.isInfoEnabled()) {
+ _log.info("Record from external database:");
+ }
+
+ if (_log.isInfoEnabled()) {
+ _log.info("ID: " + resultSet.getString("id"));
+ }
+
+ if (_log.isInfoEnabled()) {
+ _log.info(
+ "Name: " + resultSet.getString("name") +
+ System.lineSeparator());
+ }
+ }
+
+ connection.close();
+ }
+ catch (SQLException sqle) {
+ _log.error("Failed to retrieve data from external database!", sqle);
+ }
+ }
+
+ private static final Log _log = LogFactoryUtil.getLog(
+ CountryLocalServiceImpl.class);
+
+}
\ No newline at end of file
diff --git a/liferay-workspace/apps/service-builder/dsp/dsp-service/src/main/java/com/liferay/blade/samples/dspservicebuilder/service/persistence/impl/CountryPersistenceImpl.java b/liferay-workspace/apps/service-builder/dsp/dsp-service/src/main/java/com/liferay/blade/samples/dspservicebuilder/service/persistence/impl/CountryPersistenceImpl.java
new file mode 100644
index 000000000..11be52121
--- /dev/null
+++ b/liferay-workspace/apps/service-builder/dsp/dsp-service/src/main/java/com/liferay/blade/samples/dspservicebuilder/service/persistence/impl/CountryPersistenceImpl.java
@@ -0,0 +1,688 @@
+/**
+ * Copyright 2000-present Liferay, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.liferay.blade.samples.dspservicebuilder.service.persistence.impl;
+
+import com.liferay.blade.samples.dspservicebuilder.exception.NoSuchCountryException;
+import com.liferay.blade.samples.dspservicebuilder.model.Country;
+import com.liferay.blade.samples.dspservicebuilder.model.impl.CountryImpl;
+import com.liferay.blade.samples.dspservicebuilder.model.impl.CountryModelImpl;
+import com.liferay.blade.samples.dspservicebuilder.service.persistence.CountryPersistence;
+import com.liferay.blade.samples.dspservicebuilder.service.persistence.impl.constants.DSPCOUNTRYPersistenceConstants;
+import com.liferay.petra.string.StringBundler;
+import com.liferay.portal.kernel.configuration.Configuration;
+import com.liferay.portal.kernel.dao.orm.EntityCache;
+import com.liferay.portal.kernel.dao.orm.FinderCache;
+import com.liferay.portal.kernel.dao.orm.FinderPath;
+import com.liferay.portal.kernel.dao.orm.Query;
+import com.liferay.portal.kernel.dao.orm.QueryUtil;
+import com.liferay.portal.kernel.dao.orm.Session;
+import com.liferay.portal.kernel.dao.orm.SessionFactory;
+import com.liferay.portal.kernel.log.Log;
+import com.liferay.portal.kernel.log.LogFactoryUtil;
+import com.liferay.portal.kernel.service.persistence.impl.BasePersistenceImpl;
+import com.liferay.portal.kernel.util.GetterUtil;
+import com.liferay.portal.kernel.util.OrderByComparator;
+import com.liferay.portal.kernel.util.SetUtil;
+
+import java.io.Serializable;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.sql.DataSource;
+
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Deactivate;
+import org.osgi.service.component.annotations.Reference;
+
+/**
+ * The persistence implementation for the country service.
+ *
+ *
+ * Caching information and settings can be found in portal.properties
+ *
+ *
+ * @author Brian Wing Shun Chan
+ * @generated
+ */
+@Component(service = CountryPersistence.class)
+public class CountryPersistenceImpl
+ extends BasePersistenceImpl implements CountryPersistence {
+
+ /*
+ * NOTE FOR DEVELOPERS:
+ *
+ * Never modify or reference this class directly. Always use CountryUtil
to access the country persistence. Modify service.xml
and rerun ServiceBuilder to regenerate this class.
+ */
+ public static final String FINDER_CLASS_NAME_ENTITY =
+ CountryImpl.class.getName();
+
+ public static final String FINDER_CLASS_NAME_LIST_WITH_PAGINATION =
+ FINDER_CLASS_NAME_ENTITY + ".List1";
+
+ public static final String FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION =
+ FINDER_CLASS_NAME_ENTITY + ".List2";
+
+ private FinderPath _finderPathWithPaginationFindAll;
+ private FinderPath _finderPathWithoutPaginationFindAll;
+ private FinderPath _finderPathCountAll;
+
+ public CountryPersistenceImpl() {
+ Map dbColumnNames = new HashMap();
+
+ dbColumnNames.put("countryId", "id");
+ dbColumnNames.put("countryName", "name");
+
+ setDBColumnNames(dbColumnNames);
+
+ setModelClass(Country.class);
+
+ setModelImplClass(CountryImpl.class);
+ setModelPKClass(long.class);
+ }
+
+ /**
+ * Caches the country in the entity cache if it is enabled.
+ *
+ * @param country the country
+ */
+ @Override
+ public void cacheResult(Country country) {
+ entityCache.putResult(
+ entityCacheEnabled, CountryImpl.class, country.getPrimaryKey(),
+ country);
+
+ country.resetOriginalValues();
+ }
+
+ /**
+ * Caches the countries in the entity cache if it is enabled.
+ *
+ * @param countries the countries
+ */
+ @Override
+ public void cacheResult(List countries) {
+ for (Country country : countries) {
+ if (entityCache.getResult(
+ entityCacheEnabled, CountryImpl.class,
+ country.getPrimaryKey()) == null) {
+
+ cacheResult(country);
+ }
+ else {
+ country.resetOriginalValues();
+ }
+ }
+ }
+
+ /**
+ * Clears the cache for all countries.
+ *
+ *
+ * The EntityCache
and FinderCache
are both cleared by this method.
+ *
+ */
+ @Override
+ public void clearCache() {
+ entityCache.clearCache(CountryImpl.class);
+
+ finderCache.clearCache(FINDER_CLASS_NAME_ENTITY);
+ finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
+ finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
+ }
+
+ /**
+ * Clears the cache for the country.
+ *
+ *
+ * The EntityCache
and FinderCache
are both cleared by this method.
+ *
+ */
+ @Override
+ public void clearCache(Country country) {
+ entityCache.removeResult(
+ entityCacheEnabled, CountryImpl.class, country.getPrimaryKey());
+
+ finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
+ finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
+ }
+
+ @Override
+ public void clearCache(List countries) {
+ finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
+ finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
+
+ for (Country country : countries) {
+ entityCache.removeResult(
+ entityCacheEnabled, CountryImpl.class, country.getPrimaryKey());
+ }
+ }
+
+ public void clearCache(Set primaryKeys) {
+ finderCache.clearCache(FINDER_CLASS_NAME_ENTITY);
+ finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
+ finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
+
+ for (Serializable primaryKey : primaryKeys) {
+ entityCache.removeResult(
+ entityCacheEnabled, CountryImpl.class, primaryKey);
+ }
+ }
+
+ /**
+ * Creates a new country with the primary key. Does not add the country to the database.
+ *
+ * @param countryId the primary key for the new country
+ * @return the new country
+ */
+ @Override
+ public Country create(long countryId) {
+ Country country = new CountryImpl();
+
+ country.setNew(true);
+ country.setPrimaryKey(countryId);
+
+ return country;
+ }
+
+ /**
+ * Removes the country with the primary key from the database. Also notifies the appropriate model listeners.
+ *
+ * @param countryId the primary key of the country
+ * @return the country that was removed
+ * @throws NoSuchCountryException if a country with the primary key could not be found
+ */
+ @Override
+ public Country remove(long countryId) throws NoSuchCountryException {
+ return remove((Serializable)countryId);
+ }
+
+ /**
+ * Removes the country with the primary key from the database. Also notifies the appropriate model listeners.
+ *
+ * @param primaryKey the primary key of the country
+ * @return the country that was removed
+ * @throws NoSuchCountryException if a country with the primary key could not be found
+ */
+ @Override
+ public Country remove(Serializable primaryKey)
+ throws NoSuchCountryException {
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ Country country = (Country)session.get(
+ CountryImpl.class, primaryKey);
+
+ if (country == null) {
+ if (_log.isDebugEnabled()) {
+ _log.debug(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
+ }
+
+ throw new NoSuchCountryException(
+ _NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
+ }
+
+ return remove(country);
+ }
+ catch (NoSuchCountryException noSuchEntityException) {
+ throw noSuchEntityException;
+ }
+ catch (Exception exception) {
+ throw processException(exception);
+ }
+ finally {
+ closeSession(session);
+ }
+ }
+
+ @Override
+ protected Country removeImpl(Country country) {
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ if (!session.contains(country)) {
+ country = (Country)session.get(
+ CountryImpl.class, country.getPrimaryKeyObj());
+ }
+
+ if (country != null) {
+ session.delete(country);
+ }
+ }
+ catch (Exception exception) {
+ throw processException(exception);
+ }
+ finally {
+ closeSession(session);
+ }
+
+ if (country != null) {
+ clearCache(country);
+ }
+
+ return country;
+ }
+
+ @Override
+ public Country updateImpl(Country country) {
+ boolean isNew = country.isNew();
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ if (country.isNew()) {
+ session.save(country);
+
+ country.setNew(false);
+ }
+ else {
+ country = (Country)session.merge(country);
+ }
+ }
+ catch (Exception exception) {
+ throw processException(exception);
+ }
+ finally {
+ closeSession(session);
+ }
+
+ finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
+
+ if (isNew) {
+ finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
+ finderCache.removeResult(
+ _finderPathWithoutPaginationFindAll, FINDER_ARGS_EMPTY);
+ }
+
+ entityCache.putResult(
+ entityCacheEnabled, CountryImpl.class, country.getPrimaryKey(),
+ country, false);
+
+ country.resetOriginalValues();
+
+ return country;
+ }
+
+ /**
+ * Returns the country with the primary key or throws a com.liferay.portal.kernel.exception.NoSuchModelException
if it could not be found.
+ *
+ * @param primaryKey the primary key of the country
+ * @return the country
+ * @throws NoSuchCountryException if a country with the primary key could not be found
+ */
+ @Override
+ public Country findByPrimaryKey(Serializable primaryKey)
+ throws NoSuchCountryException {
+
+ Country country = fetchByPrimaryKey(primaryKey);
+
+ if (country == null) {
+ if (_log.isDebugEnabled()) {
+ _log.debug(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
+ }
+
+ throw new NoSuchCountryException(
+ _NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
+ }
+
+ return country;
+ }
+
+ /**
+ * Returns the country with the primary key or throws a NoSuchCountryException
if it could not be found.
+ *
+ * @param countryId the primary key of the country
+ * @return the country
+ * @throws NoSuchCountryException if a country with the primary key could not be found
+ */
+ @Override
+ public Country findByPrimaryKey(long countryId)
+ throws NoSuchCountryException {
+
+ return findByPrimaryKey((Serializable)countryId);
+ }
+
+ /**
+ * Returns the country with the primary key or returns null
if it could not be found.
+ *
+ * @param countryId the primary key of the country
+ * @return the country, or null
if a country with the primary key could not be found
+ */
+ @Override
+ public Country fetchByPrimaryKey(long countryId) {
+ return fetchByPrimaryKey((Serializable)countryId);
+ }
+
+ /**
+ * Returns all the countries.
+ *
+ * @return the countries
+ */
+ @Override
+ public List findAll() {
+ return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
+ }
+
+ /**
+ * Returns a range of all the countries.
+ *
+ *
+ * Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent, then the query will include the default ORDER BY logic from CountryModelImpl
.
+ *
+ *
+ * @param start the lower bound of the range of countries
+ * @param end the upper bound of the range of countries (not inclusive)
+ * @return the range of countries
+ */
+ @Override
+ public List findAll(int start, int end) {
+ return findAll(start, end, null);
+ }
+
+ /**
+ * Returns an ordered range of all the countries.
+ *
+ *
+ * Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent, then the query will include the default ORDER BY logic from CountryModelImpl
.
+ *
+ *
+ * @param start the lower bound of the range of countries
+ * @param end the upper bound of the range of countries (not inclusive)
+ * @param orderByComparator the comparator to order the results by (optionally null
)
+ * @return the ordered range of countries
+ */
+ @Override
+ public List findAll(
+ int start, int end, OrderByComparator orderByComparator) {
+
+ return findAll(start, end, orderByComparator, true);
+ }
+
+ /**
+ * Returns an ordered range of all the countries.
+ *
+ *
+ * Useful when paginating results. Returns a maximum of