Skip to content

Commit

Permalink
LPS-9269 Scope asset stats per group
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.liferay.com/repos/public/portal/trunk@52012 05bdf26c-840f-0410-9ced-eb539d925f36
  • Loading branch information
brianchandotcom committed May 7, 2010
1 parent e32728d commit c53d437
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 3 deletions.
1 change: 1 addition & 0 deletions portal-impl/src/META-INF/portal-hbm.xml
Expand Up @@ -1870,6 +1870,7 @@
<id name="equityAssetEntryId" type="long">
<generator class="assigned" />
</id>
<property name="groupId" type="com.liferay.portal.dao.orm.hibernate.LongType" />
<property name="companyId" type="com.liferay.portal.dao.orm.hibernate.LongType" />
<property name="userId" type="com.liferay.portal.dao.orm.hibernate.LongType" />
<property name="assetEntryId" type="com.liferay.portal.dao.orm.hibernate.LongType" />
Expand Down
1 change: 1 addition & 0 deletions portal-impl/src/META-INF/portal-model-hints.xml
Expand Up @@ -1765,6 +1765,7 @@
</model>
<model name="com.liferay.portlet.social.model.SocialEquityAssetEntry">
<field name="equityAssetEntryId" type="long" />
<field name="groupId" type="long" />
<field name="companyId" type="long" />
<field name="userId" type="long" />
<field name="assetEntryId" type="long" />
Expand Down
1 change: 1 addition & 0 deletions portal-impl/src/META-INF/portal-orm.xml
Expand Up @@ -2290,6 +2290,7 @@
<mapped-superclass class="com.liferay.portlet.social.model.impl.SocialEquityAssetEntryModelImpl">
<attributes>
<id name="equityAssetEntryId" />
<basic name="groupId" />
<basic name="companyId" />
<basic name="userId" />
<basic name="assetEntryId" />
Expand Down
Expand Up @@ -59,14 +59,15 @@ public class SocialEquityAssetEntryModelImpl extends BaseModelImpl<SocialEquityA
public static final String TABLE_NAME = "SocialEquityAssetEntry";
public static final Object[][] TABLE_COLUMNS = {
{ "equityAssetEntryId", new Integer(Types.BIGINT) },
{ "groupId", new Integer(Types.BIGINT) },
{ "companyId", new Integer(Types.BIGINT) },
{ "userId", new Integer(Types.BIGINT) },
{ "assetEntryId", new Integer(Types.BIGINT) },
{ "informationK", new Integer(Types.DOUBLE) },
{ "informationB", new Integer(Types.DOUBLE) },
{ "informationEquity", new Integer(Types.DOUBLE) }
};
public static final String TABLE_SQL_CREATE = "create table SocialEquityAssetEntry (equityAssetEntryId LONG not null primary key,companyId LONG,userId LONG,assetEntryId LONG,informationK DOUBLE,informationB DOUBLE,informationEquity DOUBLE)";
public static final String TABLE_SQL_CREATE = "create table SocialEquityAssetEntry (equityAssetEntryId LONG not null primary key,groupId LONG,companyId LONG,userId LONG,assetEntryId LONG,informationK DOUBLE,informationB DOUBLE,informationEquity DOUBLE)";
public static final String TABLE_SQL_DROP = "drop table SocialEquityAssetEntry";
public static final String DATA_SOURCE = "liferayDataSource";
public static final String SESSION_FACTORY = "liferaySessionFactory";
Expand All @@ -83,6 +84,7 @@ public static SocialEquityAssetEntry toModel(
SocialEquityAssetEntry model = new SocialEquityAssetEntryImpl();

model.setEquityAssetEntryId(soapModel.getEquityAssetEntryId());
model.setGroupId(soapModel.getGroupId());
model.setCompanyId(soapModel.getCompanyId());
model.setUserId(soapModel.getUserId());
model.setAssetEntryId(soapModel.getAssetEntryId());
Expand Down Expand Up @@ -130,6 +132,14 @@ public void setEquityAssetEntryId(long equityAssetEntryId) {
_equityAssetEntryId = equityAssetEntryId;
}

public long getGroupId() {
return _groupId;
}

public void setGroupId(long groupId) {
_groupId = groupId;
}

public long getCompanyId() {
return _companyId;
}
Expand Down Expand Up @@ -224,6 +234,7 @@ public Object clone() {
SocialEquityAssetEntryImpl clone = new SocialEquityAssetEntryImpl();

clone.setEquityAssetEntryId(getEquityAssetEntryId());
clone.setGroupId(getGroupId());
clone.setCompanyId(getCompanyId());
clone.setUserId(getUserId());
clone.setAssetEntryId(getAssetEntryId());
Expand Down Expand Up @@ -277,10 +288,12 @@ public int hashCode() {
}

public String toString() {
StringBundler sb = new StringBundler(15);
StringBundler sb = new StringBundler(17);

sb.append("{equityAssetEntryId=");
sb.append(getEquityAssetEntryId());
sb.append(", groupId=");
sb.append(getGroupId());
sb.append(", companyId=");
sb.append(getCompanyId());
sb.append(", userId=");
Expand All @@ -299,7 +312,7 @@ public String toString() {
}

public String toXmlString() {
StringBundler sb = new StringBundler(25);
StringBundler sb = new StringBundler(28);

sb.append("<model><model-name>");
sb.append("com.liferay.portlet.social.model.SocialEquityAssetEntry");
Expand All @@ -309,6 +322,10 @@ public String toXmlString() {
"<column><column-name>equityAssetEntryId</column-name><column-value><![CDATA[");
sb.append(getEquityAssetEntryId());
sb.append("]]></column-value></column>");
sb.append(
"<column><column-name>groupId</column-name><column-value><![CDATA[");
sb.append(getGroupId());
sb.append("]]></column-value></column>");
sb.append(
"<column><column-name>companyId</column-name><column-value><![CDATA[");
sb.append(getCompanyId());
Expand Down Expand Up @@ -340,6 +357,7 @@ public String toXmlString() {
}

private long _equityAssetEntryId;
private long _groupId;
private long _companyId;
private long _userId;
private String _userUuid;
Expand Down
4 changes: 4 additions & 0 deletions portal-impl/src/com/liferay/portlet/social/service.xml
Expand Up @@ -85,6 +85,10 @@

<column name="equityAssetEntryId" type="long" primary="true" />

<!-- Group instance -->

<column name="groupId" type="long" />

<!-- Audit fields -->

<column name="companyId" type="long" />
Expand Down
Expand Up @@ -291,6 +291,7 @@ protected SocialEquityAssetEntry toUnwrappedModel(
socialEquityAssetEntryImpl.setPrimaryKey(socialEquityAssetEntry.getPrimaryKey());

socialEquityAssetEntryImpl.setEquityAssetEntryId(socialEquityAssetEntry.getEquityAssetEntryId());
socialEquityAssetEntryImpl.setGroupId(socialEquityAssetEntry.getGroupId());
socialEquityAssetEntryImpl.setCompanyId(socialEquityAssetEntry.getCompanyId());
socialEquityAssetEntryImpl.setUserId(socialEquityAssetEntry.getUserId());
socialEquityAssetEntryImpl.setAssetEntryId(socialEquityAssetEntry.getAssetEntryId());
Expand Down
Expand Up @@ -68,6 +68,7 @@ public void testUpdateExisting() throws Exception {

SocialEquityAssetEntry newSocialEquityAssetEntry = _persistence.create(pk);

newSocialEquityAssetEntry.setGroupId(nextLong());
newSocialEquityAssetEntry.setCompanyId(nextLong());
newSocialEquityAssetEntry.setUserId(nextLong());
newSocialEquityAssetEntry.setAssetEntryId(nextLong());
Expand All @@ -81,6 +82,8 @@ public void testUpdateExisting() throws Exception {

assertEquals(existingSocialEquityAssetEntry.getEquityAssetEntryId(),
newSocialEquityAssetEntry.getEquityAssetEntryId());
assertEquals(existingSocialEquityAssetEntry.getGroupId(),
newSocialEquityAssetEntry.getGroupId());
assertEquals(existingSocialEquityAssetEntry.getCompanyId(),
newSocialEquityAssetEntry.getCompanyId());
assertEquals(existingSocialEquityAssetEntry.getUserId(),
Expand Down Expand Up @@ -168,6 +171,7 @@ protected SocialEquityAssetEntry addSocialEquityAssetEntry()

SocialEquityAssetEntry socialEquityAssetEntry = _persistence.create(pk);

socialEquityAssetEntry.setGroupId(nextLong());
socialEquityAssetEntry.setCompanyId(nextLong());
socialEquityAssetEntry.setUserId(nextLong());
socialEquityAssetEntry.setAssetEntryId(nextLong());
Expand Down
Expand Up @@ -50,6 +50,10 @@ public interface SocialEquityAssetEntryModel extends BaseModel<SocialEquityAsset

public void setEquityAssetEntryId(long equityAssetEntryId);

public long getGroupId();

public void setGroupId(long groupId);

public long getCompanyId();

public void setCompanyId(long companyId);
Expand Down
Expand Up @@ -42,6 +42,7 @@ public static SocialEquityAssetEntrySoap toSoapModel(
SocialEquityAssetEntrySoap soapModel = new SocialEquityAssetEntrySoap();

soapModel.setEquityAssetEntryId(model.getEquityAssetEntryId());
soapModel.setGroupId(model.getGroupId());
soapModel.setCompanyId(model.getCompanyId());
soapModel.setUserId(model.getUserId());
soapModel.setAssetEntryId(model.getAssetEntryId());
Expand Down Expand Up @@ -111,6 +112,14 @@ public void setEquityAssetEntryId(long equityAssetEntryId) {
_equityAssetEntryId = equityAssetEntryId;
}

public long getGroupId() {
return _groupId;
}

public void setGroupId(long groupId) {
_groupId = groupId;
}

public long getCompanyId() {
return _companyId;
}
Expand Down Expand Up @@ -160,6 +169,7 @@ public void setInformationEquity(double informationEquity) {
}

private long _equityAssetEntryId;
private long _groupId;
private long _companyId;
private long _userId;
private long _assetEntryId;
Expand Down
Expand Up @@ -53,6 +53,14 @@ public void setEquityAssetEntryId(long equityAssetEntryId) {
_socialEquityAssetEntry.setEquityAssetEntryId(equityAssetEntryId);
}

public long getGroupId() {
return _socialEquityAssetEntry.getGroupId();
}

public void setGroupId(long groupId) {
_socialEquityAssetEntry.setGroupId(groupId);
}

public long getCompanyId() {
return _socialEquityAssetEntry.getCompanyId();
}
Expand Down
1 change: 1 addition & 0 deletions sql/portal-tables.sql
Expand Up @@ -1476,6 +1476,7 @@ create table SocialActivity (

create table SocialEquityAssetEntry (
equityAssetEntryId LONG not null primary key,
groupId LONG,
companyId LONG,
userId LONG,
assetEntryId LONG,
Expand Down
1 change: 1 addition & 0 deletions sql/update-6.0.1-6.0.2.sql
Expand Up @@ -4,6 +4,7 @@ alter table LayoutSet add settings_ TEXT null;

create table SocialEquityAssetEntry (
equityAssetEntryId LONG not null primary key,
groupId LONG,
companyId LONG,
userId LONG,
assetEntryId LONG,
Expand Down

0 comments on commit c53d437

Please sign in to comment.