Skip to content
Newer
Older
100644 241 lines (169 sloc) 8.95 KB
bd28cb1 @beberlei DDC-645 - Demoted <change-tracking-policy /> to an attribute on <enti…
beberlei authored
1 # Update from 2.0-BETA3 to 2.0-BETA4
2
3 ## XML Driver <change-tracking-policy /> element demoted to attribute
4
5 We changed how the XML Driver allows to define the change-tracking-policy. The working case is now:
6
7 <entity change-tracking-policy="DEFERRED_IMPLICT" />
8
434325e @beberlei Fixed DDC-557 - Default allocation size for sequences changed from 10…
beberlei authored
9 # Update from 2.0-BETA2 to 2.0-BETA3
10
0bc22a2 @beberlei Updated UPDATE_TO_2_0 document with BC changes and stuff related to t…
beberlei authored
11 ## Serialization of Uninitialized Proxies
12
13 As of Beta3 you can now serialize uninitialized proxies, an exception will only be thrown when
14 trying to access methods on the unserialized proxy as long as it has not been re-attached to the
15 EntityManager using `EntityManager#merge()`. See this example:
16
17 $proxy = $em->getReference('User', 1);
18
19 $serializedProxy = serialize($proxy);
20 $detachedProxy = unserialized($serializedProxy);
21
22 echo $em->contains($detachedProxy); // FALSE
23
24 try {
25 $detachedProxy->getId(); // uninitialized detached proxy
26 } catch(Exception $e) {
27
28 }
29 $attachedProxy = $em->merge($detachedProxy);
30 echo $attackedProxy->getId(); // works!
31
32 ## Changed SQL implementation of Postgres and Oracle DateTime types
33
34 The DBAL Type "datetime" included the Timezone Offset in both Postgres and Oracle. As of this version they are now
35 generated without Timezone (TIMESTAMP WITHOUT TIME ZONE instead of TIMESTAMP WITH TIME ZONE).
36 See [this comment to Ticket DBAL-22](http://www.doctrine-project.org/jira/browse/DBAL-22?focusedCommentId=13396&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_13396)
37 for more details as well as migration issues for PostgreSQL and Oracle.
38
39 Both Postgres and Oracle will throw Exceptions during hydration of Objects with "DateTime" fields unless migration steps are taken!
40
41 ## Removed multi-dot/deep-path expressions in DQL
42
43 The support for implicit joins in DQL through the multi-dot/Deep Path Expressions
44 was dropped. For example:
45
46 SELECT u FROM User u WHERE u.group.name = ?1
47
48 See the "u.group.id" here is using multi dots (deep expression) to walk
49 through the graph of objects and properties. Internally the DQL parser
50 would rewrite these queries to:
51
52 SELECT u FROM User u JOIN u.group g WHERE g.name = ?1
53
54 This explicit notation will be the only supported notation as of now. The internal
55 handling of multi-dots in the DQL Parser was very complex, error prone in edge cases
56 and required special treatment for several features we added. Additionally
57 it had edge cases that could not be solved without making the DQL Parser
58 even much more complex. For this reason we will drop the support for the
59 deep path expressions to increase maintainability and overall performance
60 of the DQL parsing process. This will benefit any DQL query being parsed,
61 even those not using deep path expressions.
62
63 Note that the generated SQL of both notations is exactly the same! You
64 don't loose anything through this.
65
434325e @beberlei Fixed DDC-557 - Default allocation size for sequences changed from 10…
beberlei authored
66 ## Default Allocation Size for Sequences
67
68 The default allocation size for sequences has been changed from 10 to 1. This step was made
69 to not cause confusion with users and also because it is partly some kind of premature optimization.
70
af76c5f @beberlei Updated UPGRADE file for 2.0 BETA 2 release and added a small README
beberlei authored
71 # Update from 2.0-BETA1 to 2.0-BETA2
72
73 There are no backwards incompatible changes in this release.
cb1c7bc [2.0] DBAL cleanups (DDC-46). Proxy class improvements (DDC-19, DDC-3…
romanb authored
74
a53c2fb [2.0] Code cleanups. Preparations for DDC-193. Fixed DDC-399, type co…
romanb authored
75 # Upgrade from 2.0-ALPHA4 to 2.0-BETA1
4e8e7b8 [2.0] DDC-277 - Added entry to UPGRADE_TO_2_0 Readme about removal of…
beberlei authored
76
025735e @beberlei DDC-536 - Make forwards compatible change in EntityRepository adding …
beberlei authored
77 ## EntityRepository deprecates access to protected variables
78
79 Instead of accessing protected variables for the EntityManager in
80 a custom EntityRepository it is now required to use the getter methods
81 for all the three instance variables:
82
83 * `$this->_em` now accessible through `$this->getEntityManager()`
84 * `$this->_class` now accessible through `$this->getClassMetadata()`
85 * `$this->_entityName` now accessible through `$this->getEntityName()`
86
87 Important: For Beta 2 the protected visibility of these three properties will be
88 changed to private!
89
3bb6184 @beberlei Updated UPGRADE_TO_2_0 file with recent changes
beberlei authored
90 ## Console migrated to Symfony Console
91
2f3e9fd @romanb Updated UPGRADE file.
romanb authored
92 The Doctrine CLI has been replaced by Symfony Console Configuration
3bb6184 @beberlei Updated UPGRADE_TO_2_0 file with recent changes
beberlei authored
93
2f3e9fd @romanb Updated UPGRADE file.
romanb authored
94 Instead of having to specify:
3bb6184 @beberlei Updated UPGRADE_TO_2_0 file with recent changes
beberlei authored
95
96 [php]
97 $cliConfig = new CliConfiguration();
98 $cliConfig->setAttribute('em', $entityManager);
99
100 You now have to configure the script like:
101
102 [php]
103 $helperSet = new \Symfony\Components\Console\Helper\HelperSet(array(
104 'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()),
105 'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em)
106 ));
107
108 ## Console: No need for Mapping Paths anymore
109
110 In previous versions you had to specify the --from and --from-path options
111 to show where your mapping paths are from the console. However this information
112 is already known from the Mapping Driver configuration, so the requirement
113 for this options were dropped.
114
115 Instead for each console command all the entities are loaded and to
116 restrict the operation to one or more sub-groups you can use the --filter flag.
117
118 ## AnnotationDriver is not a default mapping driver anymore
119
120 In conjunction with the recent changes to Console we realized that the
121 annotations driver being a default metadata driver lead to lots of glue
122 code in the console components to detect where entities lie and how to load
123 them for batch updates like SchemaTool and other commands. However the
124 annotations driver being a default driver does not really help that much
125 anyways.
126
127 Therefore we decided to break backwards compability in this issue and drop
128 the support for Annotations as Default Driver and require our users to
129 specify the driver explicitly (which allows us to ask for the path to all
130 entities).
131
132 If you are using the annotations metadata driver as default driver, you
133 have to add the following lines to your bootstrap code:
134
135 $driverImpl = $config->newDefaultAnnotationDriver(array(__DIR__."/Entities"));
136 $config->setMetadataDriverImpl($driverImpl);
137
138 You have to specify the path to your entities as either string of a single
139 path or array of multiple paths
140 to your entities. This information will be used by all console commands to
141 access all entities.
142
143 Xml and Yaml Drivers work as before!
144
145
354ede1 [2.0][DDC-354][DDC-425] Fixed. Encapsulated SQL logging better in the…
romanb authored
146 ## New inversedBy attribute
147
148 It is now *mandatory* that the owning side of a bidirectional association specifies the
149 'inversedBy' attribute that points to the name of the field on the inverse side that completes
150 the association. Example:
151
152 [php]
153 // BEFORE (ALPHA4 AND EARLIER)
154 class User
155 {
156 //...
157 /** @OneToOne(targetEntity="Address", mappedBy="user") */
158 private $address;
159 //...
160 }
161 class Address
162 {
163 //...
164 /** @OneToOne(targetEntity="User") */
1f3c798 [2.0][doc] Updated UPGRADE_TO_2_0 for the inversedBy attribute.
romanb authored
165 private $user;
354ede1 [2.0][DDC-354][DDC-425] Fixed. Encapsulated SQL logging better in the…
romanb authored
166 //...
167 }
168
169 // SINCE BETA1
170 // User class DOES NOT CHANGE
171 class Address
172 {
173 //...
174 /** @OneToOne(targetEntity="User", inversedBy="address") */
175 private $user;
176 //...
177 }
178
179 Thus, the inversedBy attribute is the counterpart to the mappedBy attribute. This change
180 was necessary to enable some simplifications and further performance improvements. We
181 apologize for the inconvenience.
182
a53c2fb [2.0] Code cleanups. Preparations for DDC-193. Fixed DDC-399, type co…
romanb authored
183 ## Default Property for Field Mappings
4e8e7b8 [2.0] DDC-277 - Added entry to UPGRADE_TO_2_0 Readme about removal of…
beberlei authored
184
a53c2fb [2.0] Code cleanups. Preparations for DDC-193. Fixed DDC-399, type co…
romanb authored
185 The "default" option for database column defaults has been removed. If desired, database column defaults can
186 be implemented by using the columnDefinition attribute of the @Column annotation (or the approriate XML and YAML equivalents).
187 Prefer PHP default values, if possible.
4e8e7b8 [2.0] DDC-277 - Added entry to UPGRADE_TO_2_0 Readme about removal of…
beberlei authored
188
2f3e9fd @romanb Updated UPGRADE file.
romanb authored
189 ## Selecting Partial Objects
bbda52a [2.0] DDC-376 - Fix in XML Mapping Driver 'inheritance-type' attribute.
beberlei authored
190
2f3e9fd @romanb Updated UPGRADE file.
romanb authored
191 Querying for partial objects now has a new syntax. The old syntax to query for partial objects
192 now has a different meaning. This is best illustrated by an example. If you previously
193 had a DQL query like this:
194
195 [sql]
196 SELECT u.id, u.name FROM User u
197
198 Since BETA1, simple state field path expressions in the select clause are used to select
199 object fields as plain scalar values (something that was not possible before).
200 To achieve the same result as previously (that is, a partial object with only id and name populated)
201 you need to use the following, explicit syntax:
202
203 [sql]
204 SELECT PARTIAL u.{id,name} FROM User u
a53c2fb [2.0] Code cleanups. Preparations for DDC-193. Fixed DDC-399, type co…
romanb authored
205
bbda52a [2.0] DDC-376 - Fix in XML Mapping Driver 'inheritance-type' attribute.
beberlei authored
206 ## XML Mapping Driver
207
208 The 'inheritance-type' attribute changed to take last bit of ClassMetadata constant names, i.e.
209 NONE, SINGLE_TABLE, INHERITANCE_TYPE_JOINED
210
2cfe338 [2.0] DDC-412 - Fixed YAML Driver not allowing multiple lifecycle cal…
beberlei authored
211 ## YAML Mapping Driver
212
213 The way to specify lifecycle callbacks in YAML Mapping driver was changed to allow for multiple callbacks
214 per event. The Old syntax ways:
215
216 [yaml]
217 lifecycleCallbacks:
fcb12ee [2.0] DDC-412 - Fixed YAML Driver not allowing multiple lifecycle cal…
beberlei authored
218 doStuffOnPrePersist: prePersist
219 doStuffOnPostPersist: postPersist
2cfe338 [2.0] DDC-412 - Fixed YAML Driver not allowing multiple lifecycle cal…
beberlei authored
220
221 The new syntax is:
222
223 [yaml]
224 lifecycleCallbacks:
225 prePersist: [ doStuffOnPrePersist, doOtherStuffOnPrePersistToo ]
226 postPersist: [ doStuffOnPostPersist ]
227
a53c2fb [2.0] Code cleanups. Preparations for DDC-193. Fixed DDC-399, type co…
romanb authored
228 ## PreUpdate Event Listeners
bc6714c [2.0] DDC-414 - Changed semantics of preUpdate Event to allow only ch…
beberlei authored
229
230 Event Listeners listening to the 'preUpdate' event can only affect the primitive values of entity changesets
231 by using the API on the `PreUpdateEventArgs` instance passed to the preUpdate listener method. Any changes
232 to the state of the entitys properties won't affect the database UPDATE statement anymore. This gives drastic
233 performance benefits for the preUpdate event.
234
2f3e9fd @romanb Updated UPGRADE file.
romanb authored
235 ## Collection API
236
237 The Collection interface in the Common package has been updated with some missing methods
238 that were present only on the default implementation, ArrayCollection. Custom collection
239 implementations need to be updated to adhere to the updated interface.
240
Something went wrong with that request. Please try again.