Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 309285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:43:40+00:00 2026-05-12T07:43:40+00:00

I dont really get to work with entity beans, but they are staring at

  • 0

I dont really get to work with entity beans, but they are staring at me right now.

We have a couple of tables that are related to each other, but there are no foreign keys, and we cannot add any. For this question, the database cannot change, it’s just not possible, but as a different solution we might create views. Anyways…

I have 3 tables.
LOCATION , LINKS and ENDPOINT and for extra salt, we a a LINKS_TYPE table.

LOCATION table has a primary key LOCATIONID which is a string containing the location id.

LINKS table has a LINKID as primary key
a column LINK_ATTR_VALUE_A which contains ENDPOINT’s primary key
a column LINK_ATTR_VALUE_B which contains LOCATION’s primary key.
a column LINKTYPEID which contains a LINKS_TYPE primary key

ENDPOINT table has a primary key POINTID

LINKS_TYPE has primary key LINKTYPEID
a column LINKTYPEA (text string defining the table name it’s linked to)
a column LINKTYPEB (text string defining the table name it’s linked to)

Now even though LINKS_TYPE is mentioned, I dont need to worry about that now, because there are no other links in this instance of the database.

I would like to define a member in my LOCATION entity ‘List endPoints’
Which would be a @OneToMany from my understanding.
Do keep in mind, there is no foreign key to help here, and there wont ever be.

This is the mapping I defined…

@OneToMany ( cascade=CascadeType.ALL)
@JoinTable ( name = "ENDPOINT",
             joinColumns = @JoinColumn ( 
                                name = "LINK_ATTR_VALUE_B"
                            ),
             inverseJoinColumns = 
                            @JoinColumn ( 
                                name = "LINK_ATTR_VALUE_A"
             )
            )
private List<EndPoint> endPoints;

It’s very likely from this you might realize I have no clue what I’m doing 😀
But the documentation aint too great, and Ive ordered a book for help with ejb 3, but I just dont have the time to finish the book before this mapping 😀

We are using TopLink with jdeveloper 11g and that weblogic server thing and oracle 10g as database.

When using a serviceFacade client to query, everything did seem right (since then workspace died and I have to recreate the project to get the client working).
It generates the perfect query in my opinion to retrieve the right data.
Yet, it ends with no results.

I’m willing to give as much info as possible, just not sure what is needed.
But I know my mapping is most probably wrong, and it’s because I do not understand the mapping.

Could someone help me?

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T07:43:41+00:00Added an answer on May 12, 2026 at 7:43 am

    Your LINKS table looks like many-to-many mapping table between LOCATION and ENDPOINT rather than one-to-many. The big question here is whether it has any additional columns aside from LINKID, LINK_ATTR_VALUE_A and LINK_ATTR_VALUE_B that you listed?

    If it does, then you would have to map it as a separate entity:
    Location would have a collection of Links mapped as bi-directional one-to-many
    Link would have many-to-one relationships with both Location and EndPoint

    If, OTOH, LINKS has no other columns AND you’re willing to forgo its primary key (which is neither needed nor can be mapped for many-to-many join table) then you can map it as many-to-many collection of EndPoints on Location.

    If you can clarify your question I’ll update my answer to include the actual mapping if you need it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i really dont get it work. say i have some classes with the same
I'd really like to get into some D3D coding, but I don't have the
I don't really get lambda expressions. While they've been around since the days of
Ive decided that I really dont like microsoft and their ways. Please could you
I've tried using source control for a couple projects but still don't really understand
I have a simple ADO.NET Entity Framework 4.0 model (edmx) which defines database tables
I have some code that I use with Entity Framework like class Person{ pubic
I am a newbie for Entity frame work..I have to setup our project solution..and
I have looked through replacing colors in an image but cannot get it to
I don't really get it and it's driving me nuts. i've these 4 lines:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.