protected static interface UpgradeSocial.ExtraDataFactory
com.liferay.social.kernel.model.SocialActivity
instances) of any kind.
Implementations have to focus on:
getActivitySQLWhereClause()
and setActivitySQLParameters(PreparedStatement)
.
getSQL()
and setModelSQLParameters(PreparedStatement, long, long, long, long,
long, int, String)
.
createExtraDataJSONObject(ResultSet, String)
.
The ExtraData Framework works with a list of ExtraData factories. for
each one, a query to SocialActivity table is built and run. The extra
data for each SocialActivity
tuple returned by the query is
generated by querying the appropriate entity as dictated by the Factory
and building the extra data from that entity tuple. Then the framework
updates the extra data in the original SocialActivity
tuple,
so that the Social Activity Interpreters can find what they need after
the upgrade.
Modifier and Type | Method and Description |
---|---|
com.liferay.portal.kernel.json.JSONObject |
createExtraDataJSONObject(ResultSet resultSet,
String extraData)
Returns the JSON object containing the extra data.
|
String |
getActivityClassName()
Returns the class name of the entity whose activities the factory
generates extra data for.
|
String |
getActivitySQLWhereClause()
Returns the "where" clause in the social activity query to select the
SocialActivity tuples the factory generates extra data
for. |
String |
getSQL()
Returns the SQL query on any model entity which the selected
SocialActivity tuples refer to. |
void |
setActivitySQLParameters(PreparedStatement preparedStatement)
Sets parameters required to run the activity query returned by
getActivitySQLWhereClause() in the factory. |
void |
setModelSQLParameters(PreparedStatement preparedStatement,
long companyId,
long groupId,
long userId,
long classNameId,
long classPK,
int type,
String extraData)
Sets parameters required to run the entity query returned by
getSQL() in the factory, based on fields from the
SocialActivity tuple. |
com.liferay.portal.kernel.json.JSONObject createExtraDataJSONObject(ResultSet resultSet, String extraData) throws SQLException
getSQL()
and the original extra data in the
SocialActivity
tuple pointing to that entity, this
method computes the extra data that will be persisted in the
SocialActivity
tuple as a result of the upgrade process.SQLException
String getActivityClassName()
String getActivitySQLWhereClause()
SocialActivity
tuples the factory generates extra data
for.String getSQL()
SocialActivity
tuples refer to. Extra data is generated
from the entities returned by this query.void setActivitySQLParameters(PreparedStatement preparedStatement) throws SQLException
getActivitySQLWhereClause()
in the factory.SQLException
void setModelSQLParameters(PreparedStatement preparedStatement, long companyId, long groupId, long userId, long classNameId, long classPK, int type, String extraData) throws SQLException
getSQL()
in the factory, based on fields from the
SocialActivity
tuple.SQLException