[TYPO3-mvc] Query Building, joins and table naming.
Steffen Ritter
info at rs-websystems.de
Mon Aug 30 15:11:03 CEST 2010
Hey List,
I have comments as a domain object. Comments might be commented itself.
therefore there is an mm relation between the comment-table and itself.
Now i get a problem doing "get all comments with unread answers"
query->matching(query->equals(comments.read,0)) would do the task
anywhere else.
Extbase does not put aliasse on querybuilding... the result is:
SELECT DISTINCT tx_rsmysherpasprojects_domain_model_comment.* FROM
tx_rsmysherpasprojects_domain_model_comment LEFT JOIN
tx_rsmysherpasprojects_comment_comment_mm ON
tx_rsmysherpasprojects_domain_model_comment.uid=tx_rsmysherpasprojects_comment_comment_mm.uid_local
LEFT JOIN tx_rsmysherpasprojects_domain_model_comment ON
tx_rsmysherpasprojects_comment_comment_mm.uid_foreign=tx_rsmysherpasprojects_domain_model_comment.uid
WHERE tx_rsmysherpasprojects_domain_model_comment.read = '0'
Is there any reason why extbase does not build query like
FROM
tx_rsmysherpasprojects_domain_model_comment AS a LEFT JOIN
tx_rsmysherpasprojects_comment_comment_mm AS b ON a.uid=b.uid_local LEFT
JOIN tx_rsmysherpasprojects_domain_model_comment AS c ON
b.uid_foreign=c.uid WHERE c.read = '0'
regards
Steffen
More information about the TYPO3-project-typo3v4mvc
mailing list