MappingException.php 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772
  1. <?php
  2. /*
  3. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  4. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  5. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  6. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  7. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  8. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  9. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  10. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  11. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  12. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  13. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14. *
  15. * This software consists of voluntary contributions made by many individuals
  16. * and is licensed under the MIT license. For more information, see
  17. * <http://www.phpdoctrine.org>.
  18. */
  19. namespace Doctrine\ORM\Mapping;
  20. /**
  21. * A MappingException indicates that something is wrong with the mapping setup.
  22. *
  23. * @since 2.0
  24. */
  25. class MappingException extends \Doctrine\ORM\ORMException
  26. {
  27. /**
  28. * @return MappingException
  29. */
  30. public static function pathRequired()
  31. {
  32. return new self("Specifying the paths to your entities is required ".
  33. "in the AnnotationDriver to retrieve all class names.");
  34. }
  35. /**
  36. * @param string $entityName
  37. *
  38. * @return MappingException
  39. */
  40. public static function identifierRequired($entityName)
  41. {
  42. if (false !== ($parent = get_parent_class($entityName))) {
  43. return new self(sprintf(
  44. 'No identifier/primary key specified for Entity "%s" sub class of "%s". Every Entity must have an identifier/primary key.',
  45. $entityName, $parent
  46. ));
  47. }
  48. return new self(sprintf(
  49. 'No identifier/primary key specified for Entity "%s". Every Entity must have an identifier/primary key.',
  50. $entityName
  51. ));
  52. }
  53. /**
  54. * @param string $entityName
  55. * @param string $type
  56. *
  57. * @return MappingException
  58. */
  59. public static function invalidInheritanceType($entityName, $type)
  60. {
  61. return new self("The inheritance type '$type' specified for '$entityName' does not exist.");
  62. }
  63. /**
  64. * @return MappingException
  65. */
  66. public static function generatorNotAllowedWithCompositeId()
  67. {
  68. return new self("Id generators can't be used with a composite id.");
  69. }
  70. /**
  71. * @param string $entity
  72. *
  73. * @return MappingException
  74. */
  75. public static function missingFieldName($entity)
  76. {
  77. return new self("The field or association mapping misses the 'fieldName' attribute in entity '$entity'.");
  78. }
  79. /**
  80. * @param string $fieldName
  81. *
  82. * @return MappingException
  83. */
  84. public static function missingTargetEntity($fieldName)
  85. {
  86. return new self("The association mapping '$fieldName' misses the 'targetEntity' attribute.");
  87. }
  88. /**
  89. * @param string $fieldName
  90. *
  91. * @return MappingException
  92. */
  93. public static function missingSourceEntity($fieldName)
  94. {
  95. return new self("The association mapping '$fieldName' misses the 'sourceEntity' attribute.");
  96. }
  97. /**
  98. * @param string $entityName
  99. * @param string $fileName
  100. *
  101. * @return MappingException
  102. */
  103. public static function mappingFileNotFound($entityName, $fileName)
  104. {
  105. return new self("No mapping file found named '$fileName' for class '$entityName'.");
  106. }
  107. /**
  108. * Exception for invalid property name override.
  109. *
  110. * @param string $className The entity's name.
  111. * @param string $fieldName
  112. *
  113. * @return MappingException
  114. */
  115. public static function invalidOverrideFieldName($className, $fieldName)
  116. {
  117. return new self("Invalid field override named '$fieldName' for class '$className'.");
  118. }
  119. /**
  120. * Exception for invalid property type override.
  121. *
  122. * @param string $className The entity's name.
  123. * @param string $fieldName
  124. *
  125. * @return MappingException
  126. */
  127. public static function invalidOverrideFieldType($className, $fieldName)
  128. {
  129. return new self("The column type of attribute '$fieldName' on class '$className' could not be changed.");
  130. }
  131. /**
  132. * @param string $className
  133. * @param string $fieldName
  134. *
  135. * @return MappingException
  136. */
  137. public static function mappingNotFound($className, $fieldName)
  138. {
  139. return new self("No mapping found for field '$fieldName' on class '$className'.");
  140. }
  141. /**
  142. * @param string $className
  143. * @param string $queryName
  144. *
  145. * @return MappingException
  146. */
  147. public static function queryNotFound($className, $queryName)
  148. {
  149. return new self("No query found named '$queryName' on class '$className'.");
  150. }
  151. /**
  152. * @param string $className
  153. * @param string $resultName
  154. *
  155. * @return MappingException
  156. */
  157. public static function resultMappingNotFound($className, $resultName)
  158. {
  159. return new self("No result set mapping found named '$resultName' on class '$className'.");
  160. }
  161. /**
  162. * @param string $entity
  163. * @param string $queryName
  164. *
  165. * @return MappingException
  166. */
  167. public static function emptyQueryMapping($entity, $queryName)
  168. {
  169. return new self('Query named "'.$queryName.'" in "'.$entity.'" could not be empty.');
  170. }
  171. /**
  172. * @param string $className
  173. *
  174. * @return MappingException
  175. */
  176. public static function nameIsMandatoryForQueryMapping($className)
  177. {
  178. return new self("Query name on entity class '$className' is not defined.");
  179. }
  180. /**
  181. * @param string $entity
  182. * @param string $queryName
  183. *
  184. * @return MappingException
  185. */
  186. public static function missingQueryMapping($entity, $queryName)
  187. {
  188. return new self('Query named "'.$queryName.'" in "'.$entity.' requires a result class or result set mapping.');
  189. }
  190. /**
  191. * @param string $entity
  192. * @param string $resultName
  193. *
  194. * @return MappingException
  195. */
  196. public static function missingResultSetMappingEntity($entity, $resultName)
  197. {
  198. return new self('Result set mapping named "'.$resultName.'" in "'.$entity.' requires a entity class name.');
  199. }
  200. /**
  201. * @param string $entity
  202. * @param string $resultName
  203. *
  204. * @return MappingException
  205. */
  206. public static function missingResultSetMappingFieldName($entity, $resultName)
  207. {
  208. return new self('Result set mapping named "'.$resultName.'" in "'.$entity.' requires a field name.');
  209. }
  210. /**
  211. * @param string $className
  212. *
  213. * @return MappingException
  214. */
  215. public static function nameIsMandatoryForSqlResultSetMapping($className)
  216. {
  217. return new self("Result set mapping name on entity class '$className' is not defined.");
  218. }
  219. /**
  220. * @param string $fieldName
  221. *
  222. * @return MappingException
  223. */
  224. public static function oneToManyRequiresMappedBy($fieldName)
  225. {
  226. return new self("OneToMany mapping on field '$fieldName' requires the 'mappedBy' attribute.");
  227. }
  228. /**
  229. * @param string $fieldName
  230. *
  231. * @return MappingException
  232. */
  233. public static function joinTableRequired($fieldName)
  234. {
  235. return new self("The mapping of field '$fieldName' requires an the 'joinTable' attribute.");
  236. }
  237. /**
  238. * Called if a required option was not found but is required
  239. *
  240. * @param string $field Which field cannot be processed?
  241. * @param string $expectedOption Which option is required
  242. * @param string $hint Can optionally be used to supply a tip for common mistakes,
  243. * e.g. "Did you think of the plural s?"
  244. *
  245. * @return MappingException
  246. */
  247. static function missingRequiredOption($field, $expectedOption, $hint = '')
  248. {
  249. $message = "The mapping of field '{$field}' is invalid: The option '{$expectedOption}' is required.";
  250. if ( ! empty($hint)) {
  251. $message .= ' (Hint: ' . $hint . ')';
  252. }
  253. return new self($message);
  254. }
  255. /**
  256. * Generic exception for invalid mappings.
  257. *
  258. * @param string $fieldName
  259. *
  260. * @return MappingException
  261. */
  262. public static function invalidMapping($fieldName)
  263. {
  264. return new self("The mapping of field '$fieldName' is invalid.");
  265. }
  266. /**
  267. * Exception for reflection exceptions - adds the entity name,
  268. * because there might be long classnames that will be shortened
  269. * within the stacktrace
  270. *
  271. * @param string $entity The entity's name
  272. * @param \ReflectionException $previousException
  273. *
  274. * @return MappingException
  275. */
  276. public static function reflectionFailure($entity, \ReflectionException $previousException)
  277. {
  278. return new self('An error occurred in ' . $entity, 0, $previousException);
  279. }
  280. /**
  281. * @param string $className
  282. * @param string $joinColumn
  283. *
  284. * @return MappingException
  285. */
  286. public static function joinColumnMustPointToMappedField($className, $joinColumn)
  287. {
  288. return new self('The column ' . $joinColumn . ' must be mapped to a field in class '
  289. . $className . ' since it is referenced by a join column of another class.');
  290. }
  291. /**
  292. * @param string $className
  293. *
  294. * @return MappingException
  295. */
  296. public static function classIsNotAValidEntityOrMappedSuperClass($className)
  297. {
  298. if (false !== ($parent = get_parent_class($className))) {
  299. return new self(sprintf(
  300. 'Class "%s" sub class of "%s" is not a valid entity or mapped super class.',
  301. $className, $parent
  302. ));
  303. }
  304. return new self(sprintf(
  305. 'Class "%s" is not a valid entity or mapped super class.',
  306. $className
  307. ));
  308. }
  309. /**
  310. * @param string $className
  311. * @param string $propertyName
  312. *
  313. * @return MappingException
  314. */
  315. public static function propertyTypeIsRequired($className, $propertyName)
  316. {
  317. return new self("The attribute 'type' is required for the column description of property ".$className."::\$".$propertyName.".");
  318. }
  319. /**
  320. * @param string $className
  321. *
  322. * @return MappingException
  323. */
  324. public static function tableIdGeneratorNotImplemented($className)
  325. {
  326. return new self("TableIdGenerator is not yet implemented for use with class ".$className);
  327. }
  328. /**
  329. * @param string $entity The entity's name.
  330. * @param string $fieldName The name of the field that was already declared.
  331. *
  332. * @return MappingException
  333. */
  334. public static function duplicateFieldMapping($entity, $fieldName)
  335. {
  336. return new self('Property "'.$fieldName.'" in "'.$entity.'" was already declared, but it must be declared only once');
  337. }
  338. /**
  339. * @param string $entity
  340. * @param string $fieldName
  341. *
  342. * @return MappingException
  343. */
  344. public static function duplicateAssociationMapping($entity, $fieldName)
  345. {
  346. return new self('Property "'.$fieldName.'" in "'.$entity.'" was already declared, but it must be declared only once');
  347. }
  348. /**
  349. * @param string $entity
  350. * @param string $queryName
  351. *
  352. * @return MappingException
  353. */
  354. public static function duplicateQueryMapping($entity, $queryName)
  355. {
  356. return new self('Query named "'.$queryName.'" in "'.$entity.'" was already declared, but it must be declared only once');
  357. }
  358. /**
  359. * @param string $entity
  360. * @param string $resultName
  361. *
  362. * @return MappingException
  363. */
  364. public static function duplicateResultSetMapping($entity, $resultName)
  365. {
  366. return new self('Result set mapping named "'.$resultName.'" in "'.$entity.'" was already declared, but it must be declared only once');
  367. }
  368. /**
  369. * @param string $entity
  370. *
  371. * @return MappingException
  372. */
  373. public static function singleIdNotAllowedOnCompositePrimaryKey($entity)
  374. {
  375. return new self('Single id is not allowed on composite primary key in entity '.$entity);
  376. }
  377. /**
  378. * @param string $entity
  379. * @param string $fieldName
  380. * @param string $unsupportedType
  381. *
  382. * @return MappingException
  383. */
  384. public static function unsupportedOptimisticLockingType($entity, $fieldName, $unsupportedType)
  385. {
  386. return new self('Locking type "'.$unsupportedType.'" (specified in "'.$entity.'", field "'.$fieldName.'") '
  387. .'is not supported by Doctrine.'
  388. );
  389. }
  390. /**
  391. * @param string|null $path
  392. *
  393. * @return MappingException
  394. */
  395. public static function fileMappingDriversRequireConfiguredDirectoryPath($path = null)
  396. {
  397. if ( ! empty($path)) {
  398. $path = '[' . $path . ']';
  399. }
  400. return new self(
  401. 'File mapping drivers must have a valid directory path, ' .
  402. 'however the given path ' . $path . ' seems to be incorrect!'
  403. );
  404. }
  405. /**
  406. * Returns an exception that indicates that a class used in a discriminator map does not exist.
  407. * An example would be an outdated (maybe renamed) classname.
  408. *
  409. * @param string $className The class that could not be found
  410. * @param string $owningClass The class that declares the discriminator map.
  411. *
  412. * @return MappingException
  413. */
  414. public static function invalidClassInDiscriminatorMap($className, $owningClass)
  415. {
  416. return new self(
  417. "Entity class '$className' used in the discriminator map of class '$owningClass' ".
  418. "does not exist."
  419. );
  420. }
  421. /**
  422. * @param string $className
  423. * @param array $entries
  424. * @param array $map
  425. *
  426. * @return MappingException
  427. */
  428. public static function duplicateDiscriminatorEntry($className, array $entries, array $map)
  429. {
  430. return new self(
  431. "The entries " . implode(', ', $entries) . " in discriminator map of class '" . $className . "' is duplicated. " .
  432. "If the discriminator map is automatically generated you have to convert it to an explicit discriminator map now. " .
  433. "The entries of the current map are: @DiscriminatorMap({" . implode(', ', array_map(
  434. function($a, $b) { return "'$a': '$b'"; }, array_keys($map), array_values($map)
  435. )) . "})"
  436. );
  437. }
  438. /**
  439. * @param string $className
  440. *
  441. * @return MappingException
  442. */
  443. public static function missingDiscriminatorMap($className)
  444. {
  445. return new self("Entity class '$className' is using inheritance but no discriminator map was defined.");
  446. }
  447. /**
  448. * @param string $className
  449. *
  450. * @return MappingException
  451. */
  452. public static function missingDiscriminatorColumn($className)
  453. {
  454. return new self("Entity class '$className' is using inheritance but no discriminator column was defined.");
  455. }
  456. /**
  457. * @param string $className
  458. * @param string $type
  459. *
  460. * @return MappingException
  461. */
  462. public static function invalidDiscriminatorColumnType($className, $type)
  463. {
  464. return new self("Discriminator column type on entity class '$className' is not allowed to be '$type'. 'string' or 'integer' type variables are suggested!");
  465. }
  466. /**
  467. * @param string $className
  468. *
  469. * @return MappingException
  470. */
  471. public static function nameIsMandatoryForDiscriminatorColumns($className)
  472. {
  473. return new self("Discriminator column name on entity class '$className' is not defined.");
  474. }
  475. /**
  476. * @param string $className
  477. * @param string $fieldName
  478. *
  479. * @return MappingException
  480. */
  481. public static function cannotVersionIdField($className, $fieldName)
  482. {
  483. return new self("Setting Id field '$fieldName' as versionable in entity class '$className' is not supported.");
  484. }
  485. /**
  486. * @param string $className
  487. * @param string $fieldName
  488. * @param string $type
  489. *
  490. * @return MappingException
  491. */
  492. public static function sqlConversionNotAllowedForIdentifiers($className, $fieldName, $type)
  493. {
  494. return new self("It is not possible to set id field '$fieldName' to type '$type' in entity class '$className'. The type '$type' requires conversion SQL which is not allowed for identifiers.");
  495. }
  496. /**
  497. * @param string $className
  498. * @param string $columnName
  499. *
  500. * @return MappingException
  501. */
  502. public static function duplicateColumnName($className, $columnName)
  503. {
  504. return new self("Duplicate definition of column '".$columnName."' on entity '".$className."' in a field or discriminator column mapping.");
  505. }
  506. /**
  507. * @param string $className
  508. * @param string $field
  509. *
  510. * @return MappingException
  511. */
  512. public static function illegalToManyAssociationOnMappedSuperclass($className, $field)
  513. {
  514. return new self("It is illegal to put an inverse side one-to-many or many-to-many association on mapped superclass '".$className."#".$field."'.");
  515. }
  516. /**
  517. * @param string $className
  518. * @param string $targetEntity
  519. * @param string $targetField
  520. *
  521. * @return MappingException
  522. */
  523. public static function cannotMapCompositePrimaryKeyEntitiesAsForeignId($className, $targetEntity, $targetField)
  524. {
  525. return new self("It is not possible to map entity '".$className."' with a composite primary key ".
  526. "as part of the primary key of another entity '".$targetEntity."#".$targetField."'.");
  527. }
  528. /**
  529. * @param string $className
  530. * @param string $field
  531. *
  532. * @return MappingException
  533. */
  534. public static function noSingleAssociationJoinColumnFound($className, $field)
  535. {
  536. return new self("'$className#$field' is not an association with a single join column.");
  537. }
  538. /**
  539. * @param string $className
  540. * @param string $column
  541. *
  542. * @return MappingException
  543. */
  544. public static function noFieldNameFoundForColumn($className, $column)
  545. {
  546. return new self("Cannot find a field on '$className' that is mapped to column '$column'. Either the ".
  547. "field does not exist or an association exists but it has multiple join columns.");
  548. }
  549. /**
  550. * @param string $className
  551. * @param string $field
  552. *
  553. * @return MappingException
  554. */
  555. public static function illegalOrphanRemovalOnIdentifierAssociation($className, $field)
  556. {
  557. return new self("The orphan removal option is not allowed on an association that is ".
  558. "part of the identifier in '$className#$field'.");
  559. }
  560. /**
  561. * @param string $className
  562. * @param string $field
  563. *
  564. * @return MappingException
  565. */
  566. public static function illegalOrphanRemoval($className, $field)
  567. {
  568. return new self("Orphan removal is only allowed on one-to-one and one-to-many ".
  569. "associations, but " . $className."#" .$field . " is not.");
  570. }
  571. /**
  572. * @param string $className
  573. * @param string $field
  574. *
  575. * @return MappingException
  576. */
  577. public static function illegalInverseIdentifierAssociation($className, $field)
  578. {
  579. return new self("An inverse association is not allowed to be identifier in '$className#$field'.");
  580. }
  581. /**
  582. * @param string $className
  583. * @param string $field
  584. *
  585. * @return MappingException
  586. */
  587. public static function illegalToManyIdentifierAssociation($className, $field)
  588. {
  589. return new self("Many-to-many or one-to-many associations are not allowed to be identifier in '$className#$field'.");
  590. }
  591. /**
  592. * @param string $className
  593. *
  594. * @return MappingException
  595. */
  596. public static function noInheritanceOnMappedSuperClass($className)
  597. {
  598. return new self("Its not supported to define inheritance information on a mapped superclass '" . $className . "'.");
  599. }
  600. /**
  601. * @param string $className
  602. * @param string $rootClassName
  603. *
  604. * @return MappingException
  605. */
  606. public static function mappedClassNotPartOfDiscriminatorMap($className, $rootClassName)
  607. {
  608. return new self(
  609. "Entity '" . $className . "' has to be part of the discriminator map of '" . $rootClassName . "' " .
  610. "to be properly mapped in the inheritance hierarchy. Alternatively you can make '".$className."' an abstract class " .
  611. "to avoid this exception from occurring."
  612. );
  613. }
  614. /**
  615. * @param string $className
  616. * @param string $methodName
  617. *
  618. * @return MappingException
  619. */
  620. public static function lifecycleCallbackMethodNotFound($className, $methodName)
  621. {
  622. return new self("Entity '" . $className . "' has no method '" . $methodName . "' to be registered as lifecycle callback.");
  623. }
  624. /**
  625. * @param string $listenerName
  626. * @param string $className
  627. *
  628. * @return \Doctrine\ORM\Mapping\MappingException
  629. */
  630. public static function entityListenerClassNotFound($listenerName, $className)
  631. {
  632. return new self(sprintf('Entity Listener "%s" declared on "%s" not found.', $listenerName, $className));
  633. }
  634. /**
  635. * @param string $listenerName
  636. * @param string $methodName
  637. * @param string $className
  638. *
  639. * @return \Doctrine\ORM\Mapping\MappingException
  640. */
  641. public static function entityListenerMethodNotFound($listenerName, $methodName, $className)
  642. {
  643. return new self(sprintf('Entity Listener "%s" declared on "%s" has no method "%s".', $listenerName, $className, $methodName));
  644. }
  645. /**
  646. * @param string $className
  647. * @param string $annotation
  648. *
  649. * @return MappingException
  650. */
  651. public static function invalidFetchMode($className, $annotation)
  652. {
  653. return new self("Entity '" . $className . "' has a mapping with invalid fetch mode '" . $annotation . "'");
  654. }
  655. /**
  656. * @param string $className
  657. *
  658. * @return MappingException
  659. */
  660. public static function compositeKeyAssignedIdGeneratorRequired($className)
  661. {
  662. return new self("Entity '". $className . "' has a composite identifier but uses an ID generator other than manually assigning (Identity, Sequence). This is not supported.");
  663. }
  664. /**
  665. * @param string $targetEntity
  666. * @param string $sourceEntity
  667. * @param string $associationName
  668. *
  669. * @return MappingException
  670. */
  671. public static function invalidTargetEntityClass($targetEntity, $sourceEntity, $associationName)
  672. {
  673. return new self("The target-entity " . $targetEntity . " cannot be found in '" . $sourceEntity."#".$associationName."'.");
  674. }
  675. /**
  676. * @param array $cascades
  677. * @param string $className
  678. * @param string $propertyName
  679. *
  680. * @return MappingException
  681. */
  682. public static function invalidCascadeOption(array $cascades, $className, $propertyName)
  683. {
  684. $cascades = implode(", ", array_map(function ($e) { return "'" . $e . "'"; }, $cascades));
  685. return new self(sprintf(
  686. "You have specified invalid cascade options for %s::$%s: %s; available options: 'remove', 'persist', 'refresh', 'merge', and 'detach'",
  687. $className,
  688. $propertyName,
  689. $cascades
  690. ));
  691. }
  692. /**
  693. * @param string $className
  694. *
  695. * @return MappingException
  696. */
  697. public static function missingSequenceName($className)
  698. {
  699. return new self(
  700. sprintf('Missing "sequenceName" attribute for sequence id generator definition on class "%s".', $className)
  701. );
  702. }
  703. }