Expando 是liferay的一种自定义表格扩展的方式,从5.0就已存在 , 可以在运行时新建表格\字段\行\值.

这是一种Service Builder之外的轻量级替代扩展方式,不必像Service Builder那么繁琐,

实现的具体技术实际上是列转行,其中ExpandoValue有点像Activiti的act_ru_variable

主要有4种接口,分别是表\行\列\值

  • ExpandoTableLocalServiceUtil
  • ExpandoRowLocalServiceUtil
  • ExpandoColumnLocalServiceUtil
  • ExpandoValueLocalServiceUtil

Demo

    long classNameId = ClassNameLocalServiceUtil.getClassNameId(User.class.getName());
//新建表NewTable1
ThemeDisplay themeDisplay = (ThemeDisplay)actionRequest.getAttribute(
WebKeys.THEME_DISPLAY);
ExpandoTableLocalServiceUtil.addTable(themeDisplay.getCompanyId(),classNameId, "NewTable1"); //新建行
User user = themeDisplay.getUser();
ExpandoTable expandoTable = ExpandoTableLocalServiceUtil.getTable(themeDisplay.getCompanyId(), classNameId, "NewTable1");
ExpandoRowLocalServiceUtil.addRow(expandoTable.getTableId(), user.getUserId()); //增加一个字段
ExpandoColumn expandoColumn = ExpandoColumnLocalServiceUtil.addColumn(expandoTable.getTableId(), "MyUserColumn", ExpandoColumnConstants.STRING); //新建值
ExpandoValueLocalServiceUtil.addValue(classNameId, expandoTable.getTableId(),expandoColumn.getColumnId(), user.getUserId(), "MyUserColumnDataValue123...");

其中的classPK就是控制唯一主键的值(  在程序中是user.getUserId() ).

需要注意的是每次添加值之前必须先添加行

注意在新建行addRow操作时,如果插入重复的键值就会触发异常

ExpandoValueLocalServiceUtil代码:

/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/ package com.liferay.expando.kernel.service; import aQute.bnd.annotation.ProviderType; import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
import com.liferay.portal.kernel.util.ReferenceRegistry; /**
* Provides the local service utility for ExpandoValue. This utility wraps
* {@link com.liferay.portlet.expando.service.impl.ExpandoValueLocalServiceImpl} and is the
* primary 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 ExpandoValueLocalService
* @see com.liferay.portlet.expando.service.base.ExpandoValueLocalServiceBaseImpl
* @see com.liferay.portlet.expando.service.impl.ExpandoValueLocalServiceImpl
* @generated
*/
@ProviderType
public class ExpandoValueLocalServiceUtil {
/*
* NOTE FOR DEVELOPERS:
*
* Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.expando.service.impl.ExpandoValueLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
*/ /**
* Adds the expando value to the database. Also notifies the appropriate model listeners.
*
* @param expandoValue the expando value
* @return the expando value that was added
*/
public static com.liferay.expando.kernel.model.ExpandoValue addExpandoValue(
com.liferay.expando.kernel.model.ExpandoValue expandoValue) {
return getService().addExpandoValue(expandoValue);
} public static com.liferay.expando.kernel.model.ExpandoValue addValue(
long classNameId, long tableId, long columnId, long classPK,
java.lang.String data)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.addValue(classNameId, tableId, columnId, classPK, data);
} public static com.liferay.expando.kernel.model.ExpandoValue addValue(
long companyId, java.lang.String className, java.lang.String tableName,
java.lang.String columnName, long classPK, float data)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.addValue(companyId, className, tableName, columnName,
classPK, data);
} public static com.liferay.expando.kernel.model.ExpandoValue addValue(
long companyId, java.lang.String className, java.lang.String tableName,
java.lang.String columnName, long classPK, boolean data)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.addValue(companyId, className, tableName, columnName,
classPK, data);
} public static com.liferay.expando.kernel.model.ExpandoValue addValue(
long companyId, java.lang.String className, java.lang.String tableName,
java.lang.String columnName, long classPK, java.lang.Number data)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.addValue(companyId, className, tableName, columnName,
classPK, data);
} public static com.liferay.expando.kernel.model.ExpandoValue addValue(
long companyId, java.lang.String className, java.lang.String tableName,
java.lang.String columnName, long classPK, java.lang.Object data)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.addValue(companyId, className, tableName, columnName,
classPK, data);
} public static com.liferay.expando.kernel.model.ExpandoValue addValue(
long companyId, java.lang.String className, java.lang.String tableName,
java.lang.String columnName, long classPK, int data)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.addValue(companyId, className, tableName, columnName,
classPK, data);
} public static com.liferay.expando.kernel.model.ExpandoValue addValue(
long companyId, java.lang.String className, java.lang.String tableName,
java.lang.String columnName, long classPK, java.lang.Number[] data)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.addValue(companyId, className, tableName, columnName,
classPK, data);
} public static com.liferay.expando.kernel.model.ExpandoValue addValue(
long companyId, java.lang.String className, java.lang.String tableName,
java.lang.String columnName, long classPK, double[] data)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.addValue(companyId, className, tableName, columnName,
classPK, data);
} public static com.liferay.expando.kernel.model.ExpandoValue addValue(
long companyId, java.lang.String className, java.lang.String tableName,
java.lang.String columnName, long classPK, long data)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.addValue(companyId, className, tableName, columnName,
classPK, data);
} public static com.liferay.expando.kernel.model.ExpandoValue addValue(
long companyId, java.lang.String className, java.lang.String tableName,
java.lang.String columnName, long classPK, short data)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.addValue(companyId, className, tableName, columnName,
classPK, data);
} public static com.liferay.expando.kernel.model.ExpandoValue addValue(
long companyId, java.lang.String className, java.lang.String tableName,
java.lang.String columnName, long classPK, int[] data)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.addValue(companyId, className, tableName, columnName,
classPK, data);
} public static com.liferay.expando.kernel.model.ExpandoValue addValue(
long companyId, java.lang.String className, java.lang.String tableName,
java.lang.String columnName, long classPK, java.util.Date data)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.addValue(companyId, className, tableName, columnName,
classPK, data);
} public static com.liferay.expando.kernel.model.ExpandoValue addValue(
long companyId, java.lang.String className, java.lang.String tableName,
java.lang.String columnName, long classPK, short[] data)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.addValue(companyId, className, tableName, columnName,
classPK, data);
} public static com.liferay.expando.kernel.model.ExpandoValue addValue(
long companyId, java.lang.String className, java.lang.String tableName,
java.lang.String columnName, long classPK, long[] data)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.addValue(companyId, className, tableName, columnName,
classPK, data);
} public static com.liferay.expando.kernel.model.ExpandoValue addValue(
long companyId, java.lang.String className, java.lang.String tableName,
java.lang.String columnName, long classPK, java.util.Date[] data)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.addValue(companyId, className, tableName, columnName,
classPK, data);
} public static com.liferay.expando.kernel.model.ExpandoValue addValue(
long companyId, java.lang.String className, java.lang.String tableName,
java.lang.String columnName, long classPK, float[] data)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.addValue(companyId, className, tableName, columnName,
classPK, data);
} public static com.liferay.expando.kernel.model.ExpandoValue addValue(
long companyId, java.lang.String className, java.lang.String tableName,
java.lang.String columnName, long classPK, double data)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.addValue(companyId, className, tableName, columnName,
classPK, data);
} public static com.liferay.expando.kernel.model.ExpandoValue addValue(
long companyId, java.lang.String className, java.lang.String tableName,
java.lang.String columnName, long classPK, java.lang.String[] data)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.addValue(companyId, className, tableName, columnName,
classPK, data);
} public static com.liferay.expando.kernel.model.ExpandoValue addValue(
long companyId, java.lang.String className, java.lang.String tableName,
java.lang.String columnName, long classPK, java.lang.String data)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.addValue(companyId, className, tableName, columnName,
classPK, data);
} public static com.liferay.expando.kernel.model.ExpandoValue addValue(
long companyId, java.lang.String className, java.lang.String tableName,
java.lang.String columnName, long classPK, boolean[] data)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.addValue(companyId, className, tableName, columnName,
classPK, data);
} public static com.liferay.expando.kernel.model.ExpandoValue addValue(
long companyId, java.lang.String className, java.lang.String tableName,
java.lang.String columnName, long classPK,
java.util.Map<java.util.Locale, ?> dataMap,
java.util.Locale defautlLocale)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.addValue(companyId, className, tableName, columnName,
classPK, dataMap, defautlLocale);
} public static void addValues(long classNameId, long tableId,
java.util.List<com.liferay.expando.kernel.model.ExpandoColumn> columns,
long classPK, java.util.Map<java.lang.String, java.lang.String> data)
throws com.liferay.portal.kernel.exception.PortalException {
getService().addValues(classNameId, tableId, columns, classPK, data);
} public static void addValues(long companyId, java.lang.String className,
java.lang.String tableName, long classPK,
java.util.Map<java.lang.String, java.io.Serializable> attributes)
throws com.liferay.portal.kernel.exception.PortalException {
getService()
.addValues(companyId, className, tableName, classPK, attributes);
} public static void addValues(long companyId, long classNameId,
java.lang.String tableName, long classPK,
java.util.Map<java.lang.String, java.io.Serializable> attributes)
throws com.liferay.portal.kernel.exception.PortalException {
getService()
.addValues(companyId, classNameId, tableName, classPK, attributes);
} /**
* Creates a new expando value with the primary key. Does not add the expando value to the database.
*
* @param valueId the primary key for the new expando value
* @return the new expando value
*/
public static com.liferay.expando.kernel.model.ExpandoValue createExpandoValue(
long valueId) {
return getService().createExpandoValue(valueId);
} public static void deleteColumnValues(long columnId) {
getService().deleteColumnValues(columnId);
} /**
* Deletes the expando value from the database. Also notifies the appropriate model listeners.
*
* @param expandoValue the expando value
* @return the expando value that was removed
*/
public static com.liferay.expando.kernel.model.ExpandoValue deleteExpandoValue(
com.liferay.expando.kernel.model.ExpandoValue expandoValue) {
return getService().deleteExpandoValue(expandoValue);
} /**
* Deletes the expando value with the primary key from the database. Also notifies the appropriate model listeners.
*
* @param valueId the primary key of the expando value
* @return the expando value that was removed
* @throws PortalException if a expando value with the primary key could not be found
*/
public static com.liferay.expando.kernel.model.ExpandoValue deleteExpandoValue(
long valueId)
throws com.liferay.portal.kernel.exception.PortalException {
return getService().deleteExpandoValue(valueId);
} /**
* @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 void deleteRowValues(long rowId) {
getService().deleteRowValues(rowId);
} public static void deleteTableValues(long tableId) {
getService().deleteTableValues(tableId);
} public static void deleteValue(long columnId, long rowId)
throws com.liferay.portal.kernel.exception.PortalException {
getService().deleteValue(columnId, rowId);
} public static void deleteValue(long companyId, java.lang.String className,
java.lang.String tableName, java.lang.String columnName, long classPK)
throws com.liferay.portal.kernel.exception.PortalException {
getService()
.deleteValue(companyId, className, tableName, columnName, classPK);
} public static void deleteValue(long companyId, long classNameId,
java.lang.String tableName, java.lang.String columnName, long classPK)
throws com.liferay.portal.kernel.exception.PortalException {
getService()
.deleteValue(companyId, classNameId, tableName, columnName, classPK);
} public static void deleteValue(
com.liferay.expando.kernel.model.ExpandoValue value) {
getService().deleteValue(value);
} public static void deleteValue(long valueId)
throws com.liferay.portal.kernel.exception.PortalException {
getService().deleteValue(valueId);
} public static void deleteValues(java.lang.String className, long classPK) {
getService().deleteValues(className, classPK);
} public static void deleteValues(long classNameId, long classPK) {
getService().deleteValues(classNameId, classPK);
} 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 <T> java.util.List<T> 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.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.expando.model.impl.ExpandoValueModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
* </p>
*
* @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 <T> java.util.List<T> 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.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.expando.model.impl.ExpandoValueModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
* </p>
*
* @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 <code>null</code>)
* @return the ordered range of matching rows
*/
public static <T> java.util.List<T> dynamicQuery(
com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator<T> 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.expando.kernel.model.ExpandoValue fetchExpandoValue(
long valueId) {
return getService().fetchExpandoValue(valueId);
} public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
return getService().getActionableDynamicQuery();
} public static java.util.List<com.liferay.expando.kernel.model.ExpandoValue> getColumnValues(
long columnId, int start, int end) {
return getService().getColumnValues(columnId, start, end);
} public static java.util.List<com.liferay.expando.kernel.model.ExpandoValue> getColumnValues(
long companyId, java.lang.String className, java.lang.String tableName,
java.lang.String columnName, java.lang.String data, int start, int end) {
return getService()
.getColumnValues(companyId, className, tableName,
columnName, data, start, end);
} public static java.util.List<com.liferay.expando.kernel.model.ExpandoValue> getColumnValues(
long companyId, java.lang.String className, java.lang.String tableName,
java.lang.String columnName, int start, int end) {
return getService()
.getColumnValues(companyId, className, tableName,
columnName, start, end);
} public static java.util.List<com.liferay.expando.kernel.model.ExpandoValue> getColumnValues(
long companyId, long classNameId, java.lang.String tableName,
java.lang.String columnName, java.lang.String data, int start, int end) {
return getService()
.getColumnValues(companyId, classNameId, tableName,
columnName, data, start, end);
} public static java.util.List<com.liferay.expando.kernel.model.ExpandoValue> getColumnValues(
long companyId, long classNameId, java.lang.String tableName,
java.lang.String columnName, int start, int end) {
return getService()
.getColumnValues(companyId, classNameId, tableName,
columnName, start, end);
} public static int getColumnValuesCount(long columnId) {
return getService().getColumnValuesCount(columnId);
} public static int getColumnValuesCount(long companyId,
java.lang.String className, java.lang.String tableName,
java.lang.String columnName) {
return getService()
.getColumnValuesCount(companyId, className, tableName,
columnName);
} public static int getColumnValuesCount(long companyId,
java.lang.String className, java.lang.String tableName,
java.lang.String columnName, java.lang.String data) {
return getService()
.getColumnValuesCount(companyId, className, tableName,
columnName, data);
} public static int getColumnValuesCount(long companyId, long classNameId,
java.lang.String tableName, java.lang.String columnName) {
return getService()
.getColumnValuesCount(companyId, classNameId, tableName,
columnName);
} public static int getColumnValuesCount(long companyId, long classNameId,
java.lang.String tableName, java.lang.String columnName,
java.lang.String data) {
return getService()
.getColumnValuesCount(companyId, classNameId, tableName,
columnName, data);
} public static java.io.Serializable getData(long companyId,
java.lang.String className, java.lang.String tableName,
java.lang.String columnName, long classPK)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.getData(companyId, className, tableName, columnName, classPK);
} public static java.lang.String getData(long companyId,
java.lang.String className, java.lang.String tableName,
java.lang.String columnName, long classPK, java.lang.String defaultData)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.getData(companyId, className, tableName, columnName,
classPK, defaultData);
} public static boolean getData(long companyId, java.lang.String className,
java.lang.String tableName, java.lang.String columnName, long classPK,
boolean defaultData)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.getData(companyId, className, tableName, columnName,
classPK, defaultData);
} public static java.util.Date[] getData(long companyId,
java.lang.String className, java.lang.String tableName,
java.lang.String columnName, long classPK, java.util.Date[] defaultData)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.getData(companyId, className, tableName, columnName,
classPK, defaultData);
} public static double[] getData(long companyId, java.lang.String className,
java.lang.String tableName, java.lang.String columnName, long classPK,
double[] defaultData)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.getData(companyId, className, tableName, columnName,
classPK, defaultData);
} public static java.lang.Number[] getData(long companyId,
java.lang.String className, java.lang.String tableName,
java.lang.String columnName, long classPK,
java.lang.Number[] defaultData)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.getData(companyId, className, tableName, columnName,
classPK, defaultData);
} public static short getData(long companyId, java.lang.String className,
java.lang.String tableName, java.lang.String columnName, long classPK,
short defaultData)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.getData(companyId, className, tableName, columnName,
classPK, defaultData);
} public static float getData(long companyId, java.lang.String className,
java.lang.String tableName, java.lang.String columnName, long classPK,
float defaultData)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.getData(companyId, className, tableName, columnName,
classPK, defaultData);
} public static float[] getData(long companyId, java.lang.String className,
java.lang.String tableName, java.lang.String columnName, long classPK,
float[] defaultData)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.getData(companyId, className, tableName, columnName,
classPK, defaultData);
} public static java.util.Map<?, ?> getData(long companyId,
java.lang.String className, java.lang.String tableName,
java.lang.String columnName, long classPK,
java.util.Map<?, ?> defaultData)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.getData(companyId, className, tableName, columnName,
classPK, defaultData);
} public static java.lang.String[] getData(long companyId,
java.lang.String className, java.lang.String tableName,
java.lang.String columnName, long classPK,
java.lang.String[] defaultData)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.getData(companyId, className, tableName, columnName,
classPK, defaultData);
} public static short[] getData(long companyId, java.lang.String className,
java.lang.String tableName, java.lang.String columnName, long classPK,
short[] defaultData)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.getData(companyId, className, tableName, columnName,
classPK, defaultData);
} public static long[] getData(long companyId, java.lang.String className,
java.lang.String tableName, java.lang.String columnName, long classPK,
long[] defaultData)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.getData(companyId, className, tableName, columnName,
classPK, defaultData);
} public static boolean[] getData(long companyId, java.lang.String className,
java.lang.String tableName, java.lang.String columnName, long classPK,
boolean[] defaultData)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.getData(companyId, className, tableName, columnName,
classPK, defaultData);
} public static double getData(long companyId, java.lang.String className,
java.lang.String tableName, java.lang.String columnName, long classPK,
double defaultData)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.getData(companyId, className, tableName, columnName,
classPK, defaultData);
} public static long getData(long companyId, java.lang.String className,
java.lang.String tableName, java.lang.String columnName, long classPK,
long defaultData)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.getData(companyId, className, tableName, columnName,
classPK, defaultData);
} public static int[] getData(long companyId, java.lang.String className,
java.lang.String tableName, java.lang.String columnName, long classPK,
int[] defaultData)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.getData(companyId, className, tableName, columnName,
classPK, defaultData);
} public static java.util.Date getData(long companyId,
java.lang.String className, java.lang.String tableName,
java.lang.String columnName, long classPK, java.util.Date defaultData)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.getData(companyId, className, tableName, columnName,
classPK, defaultData);
} public static int getData(long companyId, java.lang.String className,
java.lang.String tableName, java.lang.String columnName, long classPK,
int defaultData)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.getData(companyId, className, tableName, columnName,
classPK, defaultData);
} public static java.lang.Number getData(long companyId,
java.lang.String className, java.lang.String tableName,
java.lang.String columnName, long classPK, java.lang.Number defaultData)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.getData(companyId, className, tableName, columnName,
classPK, defaultData);
} public static java.util.Map<java.lang.String, java.io.Serializable> getData(
long companyId, java.lang.String className, java.lang.String tableName,
java.util.Collection<java.lang.String> columnNames, long classPK)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.getData(companyId, className, tableName, columnNames,
classPK);
} public static java.util.List<com.liferay.expando.kernel.model.ExpandoValue> getDefaultTableColumnValues(
long companyId, java.lang.String className,
java.lang.String columnName, int start, int end) {
return getService()
.getDefaultTableColumnValues(companyId, className,
columnName, start, end);
} public static java.util.List<com.liferay.expando.kernel.model.ExpandoValue> getDefaultTableColumnValues(
long companyId, long classNameId, java.lang.String columnName,
int start, int end) {
return getService()
.getDefaultTableColumnValues(companyId, classNameId,
columnName, start, end);
} public static int getDefaultTableColumnValuesCount(long companyId,
java.lang.String className, java.lang.String columnName) {
return getService()
.getDefaultTableColumnValuesCount(companyId, className,
columnName);
} public static int getDefaultTableColumnValuesCount(long companyId,
long classNameId, java.lang.String columnName) {
return getService()
.getDefaultTableColumnValuesCount(companyId, classNameId,
columnName);
} /**
* Returns the expando value with the primary key.
*
* @param valueId the primary key of the expando value
* @return the expando value
* @throws PortalException if a expando value with the primary key could not be found
*/
public static com.liferay.expando.kernel.model.ExpandoValue getExpandoValue(
long valueId)
throws com.liferay.portal.kernel.exception.PortalException {
return getService().getExpandoValue(valueId);
} /**
* Returns a range of all the expando values.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.expando.model.impl.ExpandoValueModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
* </p>
*
* @param start the lower bound of the range of expando values
* @param end the upper bound of the range of expando values (not inclusive)
* @return the range of expando values
*/
public static java.util.List<com.liferay.expando.kernel.model.ExpandoValue> getExpandoValues(
int start, int end) {
return getService().getExpandoValues(start, end);
} /**
* Returns the number of expando values.
*
* @return the number of expando values
*/
public static int getExpandoValuesCount() {
return getService().getExpandoValuesCount();
} 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 java.lang.String getOSGiServiceIdentifier() {
return getService().getOSGiServiceIdentifier();
} public static com.liferay.portal.kernel.model.PersistedModel getPersistedModel(
java.io.Serializable primaryKeyObj)
throws com.liferay.portal.kernel.exception.PortalException {
return getService().getPersistedModel(primaryKeyObj);
} public static java.util.List<com.liferay.expando.kernel.model.ExpandoValue> getRowValues(
long companyId, java.lang.String className, java.lang.String tableName,
long classPK, int start, int end) {
return getService()
.getRowValues(companyId, className, tableName, classPK,
start, end);
} public static java.util.List<com.liferay.expando.kernel.model.ExpandoValue> getRowValues(
long companyId, long classNameId, java.lang.String tableName,
long classPK, int start, int end) {
return getService()
.getRowValues(companyId, classNameId, tableName, classPK,
start, end);
} public static java.util.List<com.liferay.expando.kernel.model.ExpandoValue> getRowValues(
long rowId) {
return getService().getRowValues(rowId);
} public static java.util.List<com.liferay.expando.kernel.model.ExpandoValue> getRowValues(
long rowId, int start, int end) {
return getService().getRowValues(rowId, start, end);
} public static int getRowValuesCount(long companyId,
java.lang.String className, java.lang.String tableName, long classPK) {
return getService()
.getRowValuesCount(companyId, className, tableName, classPK);
} public static int getRowValuesCount(long companyId, long classNameId,
java.lang.String tableName, long classPK) {
return getService()
.getRowValuesCount(companyId, classNameId, tableName, classPK);
} public static int getRowValuesCount(long rowId) {
return getService().getRowValuesCount(rowId);
} public static com.liferay.expando.kernel.model.ExpandoValue getValue(
long columnId, long rowId)
throws com.liferay.portal.kernel.exception.PortalException {
return getService().getValue(columnId, rowId);
} public static com.liferay.expando.kernel.model.ExpandoValue getValue(
long companyId, java.lang.String className, java.lang.String tableName,
java.lang.String columnName, long classPK) {
return getService()
.getValue(companyId, className, tableName, columnName,
classPK);
} public static com.liferay.expando.kernel.model.ExpandoValue getValue(
long companyId, long classNameId, java.lang.String tableName,
java.lang.String columnName, long classPK) {
return getService()
.getValue(companyId, classNameId, tableName, columnName,
classPK);
} public static com.liferay.expando.kernel.model.ExpandoValue getValue(
long tableId, long columnId, long classPK) {
return getService().getValue(tableId, columnId, classPK);
} public static com.liferay.expando.kernel.model.ExpandoValue getValue(
long valueId)
throws com.liferay.portal.kernel.exception.PortalException {
return getService().getValue(valueId);
} /**
* Updates the expando value in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
*
* @param expandoValue the expando value
* @return the expando value that was updated
*/
public static com.liferay.expando.kernel.model.ExpandoValue updateExpandoValue(
com.liferay.expando.kernel.model.ExpandoValue expandoValue) {
return getService().updateExpandoValue(expandoValue);
} public static ExpandoValueLocalService getService() {
if (_service == null) {
_service = (ExpandoValueLocalService)PortalBeanLocatorUtil.locate(ExpandoValueLocalService.class.getName()); ReferenceRegistry.registerReference(ExpandoValueLocalServiceUtil.class,
"_service");
} return _service;
} private static ExpandoValueLocalService _service;
}
还有一篇详细的介绍:
https://web.liferay.com/zh/web/meera.success/blog/-/blogs/working-with-expando-api-in-liferay

Liferay7 BPM门户开发之41: Expando API入门的更多相关文章

  1. Liferay7 BPM门户开发之37: Liferay7下的OSGi Hook集成开发

    hook开发是Liferay客制扩展的一种方式,比插件灵活,即可以扩展liferay门户,也能对原有特性进行更改,Liferay有许多内置的服务,比如用hook甚至可以覆盖Liferay服务. 可作为 ...

  2. Liferay7 BPM门户开发之17: Portlet 生命周期

    Portlet 生命周期 init() =〉 render() =〉 processAction() =〉 processEvent() =〉 serveResource() =〉destroy() ...

  3. Liferay7 BPM门户开发之10: 通用流程实现从Servlet到Portlet(Part1)

    开发目的: 实现通用流程自动化处理(即实现不需要hardcode代码的bpm统一处理后台,仅需要写少量前端html form代码和拖拽设计BPM定义) 既可独立运行或可依托于Liferay或依托其它门 ...

  4. Liferay7 BPM门户开发之12:acitiviti和liferay用户权限体系集成

    写到第12章才出现Liferay的内容,希望可以厚积薄发. 我们的目标是不使用不维护Activiti的用户组织架构,只维护Liferay的体系,这样的好处是非常明显的,即不用做组织架构的同步工作. 原 ...

  5. Liferay7 BPM门户开发之44: 集成Activiti展示流程列表

    处理依赖关系 集成Activiti之前,必须搞清楚其中的依赖关系,才能在Gradle里进行配置. 依赖关系: 例如,其中activiti-engine依赖于activiti-bpmn-converte ...

  6. Liferay7 BPM门户开发之32: 实现自定义认证登陆(定制Authentication Hook)

    第一步:修改liferay-hook.xml <?xml version="1.0"?> <!DOCTYPE hook PUBLIC "-//Lifer ...

  7. Liferay7 BPM门户开发之27: MVC Portlet插件工程开发

    官网上的教材说实话实在精简不清晰. https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/creating-an-mvc-por ...

  8. Liferay7 BPM门户开发之8: Activiti实用问题集合

    1.如何实现审核的上级获取(任务逐级审批) 这个是必备功能,通过Spring的注入+Activiti表达式可以很容易解决. 可参考: http://blog.csdn.net/sunxing007/a ...

  9. Liferay7 BPM门户开发之46: 集成Activiti用户、用户组、成员关系同步

    在实际的BPM集成开发过程中,Liferay和Activiti这两个异构的系统之间,用户.组的同步需求非常重要,用来实现签收组的概念,比如指定签收组.会签.抢签都需要用到. Activiti可以通过自 ...

随机推荐

  1. ASP.NET MVC 部署全站HTTPS

    什么是全站HTTPS 全站HTTPS就是指整个网站的所有页面,所有资源全部使用HTTPS链接. 当用户的某个请求是明文的HTTP时,应该通过HTTP状态码301永久重定向到对应的HTTPS链接. 为了 ...

  2. 为什么一个类的全局变量默认以m开头?

    某天闲着无聊,突然想起来为什么大家都习惯将全局变量使用m开头,于是追根求源,查了一些资料,虽然并不是我想要的,但是也总结一下. 在stackoverflow上就有人问: Why do most var ...

  3. Python 学习---------Day2

    第四章 介绍Python对象类型为什么使用内置类型 内置对象使程序更容易编写 内置对象是拓展的组件 内置对象往往比定制的数据结构更有效率 内置对象是语言标准的一部分Python的核心数据类型 数字 字 ...

  4. PYTHON学习之路_PYTHON基础(8)

    学习内容: Python模块介绍 1.经典类 or 新式类 2.抽象接口 3.静态方法.类方法.属性方法 4.反射 5.异常处理 6.socket编程初识 7.用socket实现get.put文件等功 ...

  5. sharepoint学习。

    企业门户:对全公司共用的信息进行统一管理.存储和发布,确保信息在公司范围内能够被及时传递 报表中心:集中管理.授权并发布所有业务报表,为各级管理人员提供各种数据.图形分析报表 办公协作:提供用户日常工 ...

  6. 解决Win7下VC++6.0与Office不兼容的问题

    在Windows7下安装Visual C++ 6.0后,如果同时安装了Microsoft Office就会出现打开文件的时候出现异常,而导致VC6崩溃. 微软已经为我们解决了问题,开发出一个插件(Fi ...

  7. blog搬迁

    因为一些个人原因,2年后继续写blog,但是blog搬到github上!具体的地址为: http://www.94geek.com 内容以linux的c开发,分布式存储和分布式计算,还有架构为主.

  8. ListView组件应用源码

    首先在xml文件中定义ListView组件 <ListView android:id="@+id/show_view_list" android:layout_width=& ...

  9. HTML5 div+css导航菜单

    HTML5 div+css导航菜单 视频 音乐 小说   故事 作品 阅读 联系

  10. 详解spring事务属性

    Spring声明式事务让我们从复杂的事务处理中得到解脱.使得我们再也无需要去处理获得连接.关闭连接.事务提交和回滚等这些操作.再也无需要我们在与事务相关的方法中处理大量的try…catch…final ...