留言板
Build-service failed when we adding mapping-table in service.xml
Raj P,修改在7 年前。
Build-service failed when we adding mapping-table in service.xml
New Member 帖子: 3 加入日期: 17-2-8 最近的帖子
Hi,
When we are adding "mapping-table" in service.xml after running build-service we got following errors.
As user table is default entity we are not adding this in our service.xml. Directly we are mapping to usermembership table. Below is our service.xml code.
Here is the error in UsermemberhsipLocalServiceBaseImpl.java. Could you please let us know how can we add mappings in liferay 7 service.xml.
Errors:
The method addUserMembership(long, long) is undefined for the type UserPersistence
The method clearUserMemberships(long) is undefined for the type UserPersistence
When we are adding "mapping-table" in service.xml after running build-service we got following errors.
As user table is default entity we are not adding this in our service.xml. Directly we are mapping to usermembership table. Below is our service.xml code.
<entity name="UserMembership" local-service="true" remote-service="true">
<!-- PK fields -->
<column name="userMembershipId" type="long" primary="true" />
<!-- Other fields -->
<column name="primaryUserId" type="long" />
<column name="organizationId" type="long" />
<column name="membershipPlanId" type="long" />
<column name="membershipPlanPaymentId" type="long" />
<column name="status" type="String" />
<column name="startDate" type="Date" />
<column name="expireDate" type="Date" />
<column name="joinDate" type="Date" />
<column name="renewalDate" type="Date" />
<column name="meansBasedDiscountType" type="String" />
<column name="meansBasedDiscountValue" type="double" />
<column name="membershipTotalAmount" type="double" />
<column name="referalUserId" type="long" />
<column name="userMembershipName" type="String" />
<column name="paymentOption" type="String" />
<column name="lastPaymentDate" type="Date" />
<column name="alsoKnownContactId" type="long" />
<column name="censusTract" type="String" />
<column name="medicationsCount" type="int" />
<column name="homeCenterId" type="long" />
<!-- Relationships -->
<column name="user" type="Collection" entity="com.liferay.portal.User" mapping-table="Users_UserMembership" />
<!-- Finder methods -->
<finder name="OrganizationId" return-type="Collection">
<finder-column name="organizationId" />
</finder>
<finder name="UserId" return-type="Collection">
<finder-column name="primaryUserId" />
</finder>
</entity>
Here is the error in UsermemberhsipLocalServiceBaseImpl.java. Could you please let us know how can we add mappings in liferay 7 service.xml.
Errors:
The method addUserMembership(long, long) is undefined for the type UserPersistence
The method clearUserMemberships(long) is undefined for the type UserPersistence
@Override
public void addUserUserMembership(long userId, long userMembershipId) {
userPersistence.addUserMembership(userId, userMembershipId);
}
/**
*/
@Override
public void addUserUserMembership(long userId, UserMembership userMembership) {
userPersistence.addUserMembership(userId, userMembership);
}
/**
*/
@Override
public void addUserUserMemberships(long userId, long[] userMembershipIds) {
userPersistence.addUserMemberships(userId, userMembershipIds);
}
/**
*/
@Override
public void addUserUserMemberships(long userId,
List<usermembership> userMemberships) {
userPersistence.addUserMemberships(userId, userMemberships);
}
/**
*/
@Override
public void clearUserUserMemberships(long userId) {
userPersistence.clearUserMemberships(userId);
}
</usermembership>
David H Nebinger,修改在7 年前。
RE: Build-service failed when we adding mapping-table in service.xml
Liferay Legend 帖子: 14914 加入日期: 06-9-2 最近的帖子
Yeah, no you can't cross class loaders like this for your mappings.
Manage your join table manually and all should be fine. Add accessors and support methods so you can encapsulate the user access, but self-management will be your only option.
Manage your join table manually and all should be fine. Add accessors and support methods so you can encapsulate the user access, but self-management will be your only option.