Help with Spring/Hibernate many to many CRUD interface?

Hi,

can you help me with how I need to design the interface for CRUD ops using the Spring/Hibernate objects below?
I am new to hibernate and I am not seeing how I need to design the interface for CRUD ops.

Do I collect values for both author and citation in one form?
Or Do I collect the citation value first then create another form to collect the author value then attach this author record below the citation  like parent/child view?

Is there an example that uses to spring/hibernate to do insert  manyToMany relation tables?

Author(authorid,lastname,firstname)
Citation(citationid, articletitle,articletype)


public class Author {

@ManyToMany
@JoinTable(name="citation_author",
joinColumns={@JoinColumn(name="authorid")},
inverseJoinColumns={@JoinColumn(name="citationid")})
public List<Citation> getCitations() {return citations;}
}

public class Citation {
@ManyToMany
@JoinTable(name="citation_author",
joinColumns={@JoinColumn(name="citationid")},
inverseJoinColumns={@JoinColumn(name="authorid")})
public List<Author> getAuthors() {return authors;}
}

Open in new window

I forgot about the association table:
author_citation (authorid,citationid)

Open in new window

dkim18Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sweetfa2Commented:
Spring Hibernate Tutorial

First off, it seems you are getting confused between your presentation layer and your model layer.

You are working on your underlying persisteance layer which is part of your object model.  Therefore how you load your information is irrelevant in terms of the design of your persistence model.

Notwithstanding that, there is no reason you couldn't take either approach at your presentation layer depending on the business use case for extracting these values.
0
sweetfa2Commented:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dkim18Author Commented:
yes, I need help with presentation. Any suggestions?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.