Giter Club home page Giter Club logo

Comments (6)

satyan avatar satyan commented on July 21, 2024

This feature is not supported right now. There's a round-about way to do it though:

You could create a class UserFriends (similar to a join table concept). Here's an example

public class UserFriend extends SugarRecord<UserFriend>{

private User user;
private User friend;

}

This way you'd be able to store a many-to-many relation.

This feature would soon be available in the library.. If you got some better idea, please do share.

from sugar.

shawnwall avatar shawnwall commented on July 21, 2024

I think the above is a suitable round-about way, but in the example above, how would you query for all friends of a given user, for example?

from sugar.

satyan avatar satyan commented on July 21, 2024

User user = User.findById(User.class, userId)
List userFriends = UserFriend.find(UserFriend.class, "user = ?", user.id);

This should give you the list. I know its not the best approach.. Should provide this facility soon..

from sugar.

tevch avatar tevch commented on July 21, 2024

Hi
Is this feature already in the library?

from sugar.

furedal avatar furedal commented on July 21, 2024

I love sugar, however i really want many-to-many relation using list. Is this being implemented yet?

from sugar.

Krishan14sharma avatar Krishan14sharma commented on July 21, 2024

hey,
Is this feature available now?

from sugar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.