Package org.apache.rave.portal.model

Examples of org.apache.rave.portal.model.MongoDbPersonAssociation


    @Override
    public boolean addFriend(String friendUsername, String username) {
        MongoDbUser follower = (MongoDbUser) template.findOne(getUsernameQuery(username));
        MongoDbUser followed = (MongoDbUser) template.findOne(getUsernameQuery(friendUsername));

        MongoDbPersonAssociation outgoing = new MongoDbPersonAssociation(followed.getId(), FriendRequestStatus.SENT, MongoDbPersonAssociation.Direction.OUTGOING);
        MongoDbPersonAssociation incoming = new MongoDbPersonAssociation(follower.getId(), FriendRequestStatus.RECEIVED, MongoDbPersonAssociation.Direction.INCOMING);

        follower.getFriends().add(outgoing);
        followed.getFriends().add(incoming);

        template.save(followed);
View Full Code Here

TOP

Related Classes of org.apache.rave.portal.model.MongoDbPersonAssociation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.