Feature #29547

@identity should make property unique in Database

Added by Torsten no-lastname-given over 9 years ago. Updated over 8 years ago.

Status:
Resolved
Priority:
Should have
Category:
Persistence
Start date:
2012-04-30
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
PHP Version:
Has patch:
No
Complexity:

Description

A Property with the @indentify annotation is currently not unique in the database.

So you could for example add 2 accounts with the same accountIdentifier. That shouldn't work.


Subtasks

Bug #36717: Remove Identity from ResourceResolvedChristian Müller2012-04-30

Actions

Related issues

Related to TYPO3.Flow - Bug #9557: It's possible to persist multiple entities with the same identity propertiesRejectedChristian Müller2010-09-01

Actions
Related to TYPO3.Flow - Feature #30933: Check for unique constraints on add()Needs FeedbackKarsten Dambekalns2011-10-14

Actions
Related to TYPO3.Flow - Bug #32823: Make combination of Account identifier and authentication provider name globally uniqueResolvedRens Admiraal2011-12-23

Actions
#1

Updated by Karsten Dambekalns over 9 years ago

  • Project changed from TYPO3 Flow Base Distribution to TYPO3.Flow
#2

Updated by Karsten Dambekalns over 9 years ago

  • Category set to Persistence
#3

Updated by Karsten Dambekalns over 9 years ago

  • Assignee set to Karsten Dambekalns
#4

Updated by Christian Müller almost 9 years ago

  • Status changed from New to Accepted
  • Assignee changed from Karsten Dambekalns to Christian Müller
  • Has patch set to No
#5

Updated by Gerrit Code Review almost 9 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9647

#6

Updated by Gerrit Code Review almost 9 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9647

#7

Updated by Gerrit Code Review almost 9 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9647

#8

Updated by Adrian Föder almost 9 years ago

User Kirab mentioned there were "problems with Resource system"; I assume it's the problem that duplicate \TYPO3\FLOW3\Resource\Resource records may occur, the identities are the following:

    /**
     * @var \TYPO3\FLOW3\Resource\ResourcePointer
     * @ORM\ManyToOne
     * @FLOW3\Identity
     */
    protected $resourcePointer;

    /**
     * @var string
     * @FLOW3\Validate(type="StringLength", options={ "maximum"=100 })
     * @FLOW3\Identity
     */
    protected $filename = '';

    /**
     * @var string
     * @FLOW3\Validate(type="StringLength", options={ "maximum"=100 })
     * @FLOW3\Identity
     */
    protected $fileExtension = '';

If you upload the exact same file with the same filename, a violation will occur because the same key emerges.
(the ResourcePointer, on the other hand, is intended to be there only once for the same file (content => SHA1).

I would even say the same goes for a Resource: if a Resource has the same filename, extension and ResourcePointer, it is the exact same file and no need for an additional recordset...

If not, or if there should me multiple recordsets for a same file (e.g. for separating ownership etc), the identity must then be a UUID, like usual. I can't see anything more that intrinsically makes a file representation unique than the name, the content and the extension...

#9

Updated by Gerrit Code Review over 8 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9647

#10

Updated by Gerrit Code Review over 8 years ago

Patch set 5 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9647

#11

Updated by Gerrit Code Review over 8 years ago

Patch set 6 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9647

#12

Updated by Karsten Dambekalns over 8 years ago

  • Target version set to 1.1

The full stack of changes can be found at https://review.typo3.org/#/q/topic:29547-unique-identity,n,z

#13

Updated by Gerrit Code Review over 8 years ago

Patch set 7 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9647

#14

Updated by Gerrit Code Review over 8 years ago

Patch set 8 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9647

#15

Updated by Gerrit Code Review over 8 years ago

Patch set 9 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9647

#16

Updated by Gerrit Code Review over 8 years ago

Patch set 10 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9647

#17

Updated by Gerrit Code Review over 8 years ago

Patch set 11 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9647

#18

Updated by Gerrit Code Review over 8 years ago

Patch set 12 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9647

#19

Updated by Gerrit Code Review over 8 years ago

Patch set 13 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9647

#20

Updated by Gerrit Code Review over 8 years ago

Patch set 14 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9647

#21

Updated by Gerrit Code Review over 8 years ago

Patch set 15 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9647

#22

Updated by Gerrit Code Review over 8 years ago

Patch set 16 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9647

#23

Updated by Christian Müller over 8 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF