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 6920677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:10:41+00:00 2026-05-27T10:10:41+00:00

consider these two entities: /** @Entity */ class String { /** @Id @Column(type=integer) *

  • 0

consider these two entities:

/** @Entity  */
class String {
    /** @Id @Column(type="integer")
     * @GeneratedValue
     */
    public $id;

    /** @Column(length=255) */
    public $name;

    /**
     * @OneToMany(targetEntity="StringTranslation", mappedBy="owner") */
    public $translations;
}

/** @Entity */
class StringTranslation {
    /** @Id @Column(type="integer")
     * @GeneratedValue
     */
    public $id;

    /* @ManyToOne(targetEntity="String", inversedBy="translations")
     * @JoinColumn(name="foreignId", referencedColumnName="id") */
    public $owner;

    /** @Column(length=2) */
    public $lang;

    /** @Column(length=255) */
    public $translation;
}

When I get the query using

$query = qb()->select(array('s', 't'))
    ->from('String', 's')
    ->leftJoin('s.translations', 't')
    ->getQuery()
    ->getSQL();

I get this result:

SELECT s0_.id AS id0, s0_.name AS name1, s1_.id AS id2, s1_.foreign_id
AS foreign_id3, s1_.lang AS lang4, s1_.translation AS translation5
FROM String s0_ LEFT JOIN

Why is the left join not being generated?

When i try to get the result of the query with

$query = qb()->select(array('s', 't'))
    ->from('String', 's')
    ->leftJoin('s.translations', 't')
    ->getQuery()
    ->getArrayResult();

this error comes up:

Fatal error: Uncaught exception ‘PDOException’ with message
‘SQLSTATE[42000]: Syntax error or access violation: 1064 You have an
error in your SQL syntax

How can this problem be solved?

  • 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-27T10:10:42+00:00Added an answer on May 27, 2026 at 10:10 am

    Found it! It all boils down to a typo. Annotations must start with /** and not with /*. Changing the line

    /* @ManyToOne(targetEntity="String", inversedBy="translations")
    

    to

    /** @ManyToOne(targetEntity="String", inversedBy="translations")
    

    solved the problem!

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

Sidebar

Related Questions

Consider these two structures: struct Task { public Int32 Id; public String Name; public
Consider I have a these two properties: public class Test { [Required(ErrorMessage = Please
Consider these classes. class Base { ... }; class Derived : public Base {
Consider these two table: <table id=prototype style=display:none;> <tr> <td></td> <td><input type=text ></td> <td><?php echo
Consider the following hibernate configuration: <class name=Person> <id name=id column=personId> <generator class=native/> </id> <set
Consider these two functions: Function A takes inputStream as parameter. public void processStream(InputStream stream)
Consider these two function definitions: void foo() { } void foo(void) { } Is
Consider these two classes mapped to the same table. One is readonly via mutable=false.
I ran across a compilation issue today that baffled me. Consider these two container
Consider these 2 pieces of code (you can assume execeptionObj is of type Object

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.