On Jan 16, 4:53 pm, colaru <
col...@gmail.com> wrote:
> Hi Richard
>
> I started to create the database schema. I have some questions
> regarding the relations between entities:
>
> - I see in your entities that you are use id's and not other object
> entities as references (I think you tray to catch just the relations
> and not exactly how will be in real persistence); for JPA we will have
What you see in the db design now is still work in progress. The
design is not complete. You are right, the first design iteration is
just to capture all the entities and their relationships. In did not
take into account how they were supposed to be implemented.
> object references; for example in Brand class:
>
> private Company company;
>
> @ManyToOne(fetch = FetchType.LAZY)
> @JoinColumn(name = "company_id")
> public Company getCompany() {
> return this.company;
> }
>
> Now I created the database schema but we must discuss the relations
> between objects. For example I see that you put in Chart:
>
> private List<Item> items;
>
> I expect to be a many to many here using a link table. It's at my
> latitude how I will model this?
Yes you have all the latitude to design the model as well. For Cart in
particular;
-a cart has 0 or more items.
-an item can be added to a cart more than once, example: a cart of
books can contains, 2 copies of the same book.
I suspect there will more of this type of relation in design of the
db. Let me know if you have suggestions or questions.
>
> I cannot run the application now (before the last commit from you it
> works) with - mvn gwt:run (and I have some compiling problems after
> updating from repo). Do you can run it locally?
Everything should run. Make sure to do a "mvn clean" first and
optionally a "mvn eclipse:clean eclipse:eclipse" if you are using
eclipse or a "mvn idea:idea" if you are using intellij's idea.
>
> I made a push but I made a mistake in naming it. It contains my
> generated entities and the database script. Are just to see how it
> looks and is my first push. You can not accept it.
Are you saying I should not pull the changes into my local repo? If
there are bit of code that you are not sure of, you can make another
clone of the repository and do your dev in it and merge when you are
satisfied.
>
> So, what I try to do now is to create the right relation between
> entities - ant to create the database schema. I see that you uploaded
> aa png file with a schema - is just as an example?
It's not an example, it's the first iteration of the design. Very
quickly done and very incomplete also. As mentioned above, you should
complete it.
>
> Regards,
> Cristian