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

  • SEARCH
  • Home
  • 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 6969453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:34:58+00:00 2026-05-27T16:34:58+00:00

I have following source: class ‘ParameterWert’ /** * @ManyToOne(targetEntity=Parameter, inversedBy=Werte) * @JoinColumn(name=Parameter_histid, referencedColumnName=HistID) */

  • 0

I have following source:

class ‘ParameterWert’

/**
 * @ManyToOne(targetEntity="Parameter", inversedBy="Werte")
 * @JoinColumn(name="Parameter_histid", referencedColumnName="HistID")
 */
protected $Parameter;

class ‘Parameter’

/**
 * @OneToMany(targetEntity="ParameterWert", mappedBy="Parameter")
 * @var ParameterWert[]
 */
protected $Werte;

This works as long as the HistID is marked with ‘@Id’:

/**
 * @Id @Column(type="integer")
 * @var integer
 */
protected $HistID;

But I dont want to mark HistID with @Id because I have antoher ID and HistID is not unique without some other fields. How to make a ManyToOne-relation on a non-ID-Member? Are there other possibilities, maybe like ‘@Index1’, …?

  • 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-27T16:34:59+00:00Added an answer on May 27, 2026 at 4:34 pm

    Wait a second, what should logically be your ID?

    If HistID is not unique by itself, maybe you can do a composite key with some other column to make it unique.

    Just to note, composite keys are not recommended in Doctrine, although they are fully supported. Maybe you are better off with just using a dummy autoincremented id…

    Anyway, never tried it, but I don’t believe that associations can work properly without specifying the ID

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

Sidebar

Related Questions

I have the following source file (CUDA_Integral_Image.cu) for a class of the same name:
I have the following class Person: public class Person { public string Name {
I have the following code with the corresponding test case: class XXX attr_accessor :source
I have the following inner class: @Entity @Table(name = SATTET0) public class SATTET0Key {
I have the following XML code <class name=ContentStreamer> <method name=sendAudio> <criteria>medium</criteria> </method> <method name=sendVideo>
I have the following validator: # Source: http://guides.rubyonrails.org/active_record_validations_callbacks.html#custom-validators # app/validators/email_validator.rb class EmailValidator < ActiveModel::EachValidator
I have the following XML source structure: <turnovers> <turnover repid=1 amount=500 rate=0.1/> <turnover repid=5
I have the following SVG source code that generates a number of boxes with
I have the following in my .screenrc source ~/bin/Screen/multiUserSettings It gives me No such
I have the following lines in my .zshrc source /etc/profile source $HOME/.profile My .profile

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.