Click here to Skip to main content
15,883,901 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I've been working on a PHP project using Doctrine 2.1 as an ORM backend. Where I've run into a problem with the entities with Doctrine.

I'm trying to separate my logical model from my database model (which is flattened for some entities). I have the following entity structure:

entity: Product
- id
- name
- license

entity: License
- description
- start date
- end date

Which I want to map to a single table, where each field of both entities is represented by one column. So the database would contain the following table:

Product
- id
- name
- licenseDescription
- licenseStartdate
- licenseEnddate

I've tried this by setting the Product up with the @Entity annotation and then mapping the license field using @EmbedOne linking it the the License entity. But when debugging the code Doctrine does not seem to want to combine both entities into a single select query and map it correctly back to the two entities.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900