Hi, You mapped those fields as identifiers and also as associations.
A few tips: * can you please make an example that reproduces the issue? * It would be nice to *NOT* have that example in YAML. * What's the entity code alike? Minimal example needed * Are auto-increment identifiers in use? * Is such a complex identifier really needed? Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Wed, Mar 22, 2017 at 9:57 AM, springercreative via doctrine-user < [email protected]> wrote: > I'm writing at the moment a fixture loader command, where i generate a > mysql-database with orm.yml-files and loading database fixture afterwards. > At the moment the loader command is working fine for tables with a simple > primary key. But now I have a table, which consists of a composited primary > key (of three columns). Two Columns ("id" and "language") are foreign keys > to another tables (with a 1:n relationship). > > > I'm getting this error message, when I make the fixture loader command > call: > > Message: An exception occurred while executing 'INSERT INTO xyzInt (id, > language, name, text, update, userID, complete) VALUES (?, ?, ?, ?, ?, ?, ?)' > with params [null, "com", "peter", "text", "2017-03-06 18:00:00", 1, 0]: > SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in > your SQL syntax; check the manual that corresponds to your MySQL server > version for the right syntax to use near 'update, userID, complete) VALUES > (NULL, 'com', 'peter', 'text', '2017-03-' at line 1 > > > And my xyzInt.orm.yml looks like this: > > > Entity\Xyzint: > type: entity > table: xyzInt > > id: > id: { type: integer, options: { default: 0, unsigned: true }, > generator: { strategy: NONE } } > language: { type: string, length: 2, options: { default: '' }, > generator: { strategy: NONE } } > name: { type: string, length: 30, options: { default: '' }, > generator: { strategy: NONE } } > > fields: > ... > > manyToOne: > Abc: > targetEntity: Abc > inversedBy: Xyzint > joinColumn: > name: id > referencedColumnName: abcID > > > And now i've got two questions: > > 1. why is field "id" not set correctly (it remains null)? Note: i want > to set individually the field "id" with no auto generated special values. > Therefore i use $connection->query('SET FOREIGN_KEY_CHECKS=0'); > 2. Is the manyToOne-correlation made correctly for a composite primary > key? Or must i use "joinColumns" instead of "joinColumn"? And when i have > to use "joinColumns" can you give me a short example, how the > orm.yml-configuration should look like? I couldn't find the correct answer > in google until now. > > Thanxs for your help. > > -- > You received this message because you are subscribed to the Google Groups > "doctrine-user" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/doctrine-user. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "doctrine-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/doctrine-user. For more options, visit https://groups.google.com/d/optout.
