Giter Club home page Giter Club logo

Comments (4)

ralscha avatar ralscha commented on July 30, 2024

Hi

Hello,

I have a question about Model Associations and formUpdate. I have an
entity1 that has many entity2. I have created a form for entity2, and I
want to update entity2. Should I have a form with the value of the foreign
key (value of the primary key of entity1), or would it be enough to
transmit only the fields that really belon to entity2 ?

I guess this depends if the user can change the reference to entity1 in the
entity2-form. If not then I don't see any reason to send the foreign key
(entity1) to the server.

Is there any need to set the associations in ExtJs (belongsTo, HasMany) ?
These are not generated when I have tried the generator and the JPA
Entities.
In general, how would you manage this kind of situation with
extdirectspring ?

Associations is something I don't have any experience so far. That's the
reason it's not yet implemented in the modelgenerator. But it is something
that's on my todo list.
So I'm not able to give give you any good advice on how to use
associations. Sorry.
Maybe somebody in the Sencha Forum http://www.sencha.com/forum/ can help
you with this question.

Ralph

from extdirectspring.

omarbelkhodja avatar omarbelkhodja commented on July 30, 2024

Thanks for your answer Ralph :) I understand that the only way to do this, is to search for entity2 using its primary key, and then update it with the new coming data.

I wanted to let you know also that you do already have some code managing associations ! In your demo application, when the application asks for a list of users, the list of users is returned, with the list of roles granted to each user. So there is already some piece of code that knows about the relation between the entity user and the entity role.

Omar

from extdirectspring.

ralscha avatar ralscha commented on July 30, 2024

I wanted to let you know also that you do already have some code managing
associations ! In your demo application, when the application asks for a
list of users, the list of users is returned, with the list of roles
granted to each user.

I forgot about that. But I didn't use the association config. Guess I have
revise this example as soon as I understand the association better. Last
week I started working on this feature for extdirectspring (associations
branch).

Ralph

from extdirectspring.

ralscha avatar ralscha commented on July 30, 2024

ModelGenerator in version 1.2.3 (released today) can now generate code for association

from extdirectspring.

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.