[Hibernate-JIRA] Commented: (ANN-390) Property pointed to by "mappedBy" not found if defined in superclass of class referenced by "targetType"
by Emmanuel Bernard (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-390?page=co... ]
Emmanuel Bernard commented on ANN-390:
--------------------------------------
What do you mean?
1. a superclass not mapped: this is expected
2. a superclass mapped as @MappedSuperclass: it seems to work for me
3. a superclass mapped as @Entity: I think this is not consistent,
in your case, assuming the superclass is named TaskImpl and the class owning the oneToMany is DeploymentPlan,
you have a @ManyToOne DeploymentPlan getDeploymentPlan(); that comes from *any* task, not only DeploymentTasks
So what you are defining is not a bidirectional relationship but some sort of threesome
> Property pointed to by "mappedBy" not found if defined in superclass of class referenced by "targetType"
> --------------------------------------------------------------------------------------------------------
>
> Key: ANN-390
> URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-390
> Project: Hibernate Annotations
> Type: Bug
> Environment: Windows XP SP2, Eclipse 3.2 final, WTP 1.5 final
> HibernateTools-3.2.0.200607060659-nightly.zip with relevant jars in org.hibernate.eclipse_3.2.0.200607060659-nightly plugin replaced with same date jars built from SVN. Removed WTP plugins from Hibernate Tools dist since I already had them loaded.
> I realize that this does not exactly match the build drivers for the nightly I'm using, but I don't think this is the issue here.
> Reporter: Adrian Sampaleanu
>
>
> When trying to open session factory in the Hibernate Console, I get:
> org.hibernate.AnnotationException: mappedBy reference an unknown property: com.tirawireless.jump.jdm.model.task.DeploymentTaskImpl.deploymentPlan in com.tirawireless.jump.jdm.model.plan.DeploymentPlanImpl.deploymentTasks
> at org.hibernate.cfg.annotations.CollectionBinder.bindStarToManySecondPass(CollectionBinder.java:503)
> .....
> The relevant property and annotation is as follows:
> @OneToMany(targetEntity = DeploymentTaskImpl.class, mappedBy = "deploymentPlan", fetch = FetchType.LAZY)
> @OrderBy(clause = "name ASC")
> @Cascade({CascadeType.SAVE_UPDATE})
> public Set<DeploymentTask> getDeploymentTasks()
> The "deploymentPlan" property is _not_ defined in DeploymentTaskImpl, but is defined in it's superclass. I would think that it should be visible when establishing the mapping above.
> Have not found this issue addressed in either the forums or JIRA.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
18 years, 4 months
[Hibernate-JIRA] Updated: (ANN-393) Documentation errors in Many-toMany Annotation explanation
by Emmanuel Bernard (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-393?page=all ]
Emmanuel Bernard updated ANN-393:
---------------------------------
Fix Version: 3.2.0
> Documentation errors in Many-toMany Annotation explanation
> ----------------------------------------------------------
>
> Key: ANN-393
> URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-393
> Project: Hibernate Annotations
> Type: Bug
> Components: documentation
> Versions: 3.2.0.cr1
> Environment: N/A
> Reporter: Pedro Lopez
> Priority: Minor
> Fix For: 3.2.0
>
>
> The section "2.2.5.3.3.2. Default values" in the Annotations Online Manual has errors when describing the default values for Many-to-Many relationships.
> 1. The first error is when the manual explains the details of the 1st example in this section. The example list 2 classes City and Store but the description makes references to Store and "Table" instead of City. Here is the actual paragraph: "A Store_Table is used as the join table. The Store_id column is a foreign key to the Store table. The implantedIn_id column is a foreign key to the City table".
> 2. The second error this section occurres when again the manual is trying to explain the second example in this section. The sample code show 2 classe Store and Customers but the explaination makes mention of the Store, Customer and "City", which doesn't appear in the example code at all. Here is the actual paragraph: "A Store_Customer is used as the join table. The stores_id column is a foreign key to the Store table. The customers_id column is a foreign key to the City table."
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
18 years, 4 months
[Hibernate-JIRA] Resolved: (ANN-397) Incomplete AnnotationException at org.hibernate.cfg.annotations.TableBinder
by Emmanuel Bernard (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-397?page=all ]
Emmanuel Bernard resolved ANN-397:
----------------------------------
Fix Version: 3.2.0
Resolution: Fixed
Assign To: Emmanuel Bernard
> Incomplete AnnotationException at org.hibernate.cfg.annotations.TableBinder
> ---------------------------------------------------------------------------
>
> Key: ANN-397
> URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-397
> Project: Hibernate Annotations
> Type: Improvement
> Components: binder
> Versions: 3.2.0.cr1
> Reporter: Diego Pires Plentz
> Assignee: Emmanuel Bernard
> Fix For: 3.2.0
>
>
> When a mapped class has the wrong number of fk collumns, an exception is throwed, but it doesnt say nothing about what class is mapped wrongly.
> //implicit case, we hope PK and FK columns are in the same order
> if ( columns.length != referencedEntity.getIdentifier().getColumnSpan() ) {
> throw new AnnotationException(
> "A Foreign key refering " + referencedEntity.getEntityName()
> + " has the wrong number of column. should be " + referencedEntity.getIdentifier()
> .getColumnSpan()
> );
> }
> Can become something like this...
> //implicit case, we hope PK and FK columns are in the same order
> if ( columns.length != referencedEntity.getIdentifier().getColumnSpan() ) {
> throw new AnnotationException(
> associatedClass.getEntityName() +
> " has a foreign key refering " + referencedEntity.getEntityName()
> + " with the wrong number of column. should be " + referencedEntity.getIdentifier()
> .getColumnSpan()
> );
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
18 years, 4 months
[Hibernate-JIRA] Commented: (ANN-401) @OrderBy does not work with inherited properties
by Emmanuel Bernard (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-401?page=co... ]
Emmanuel Bernard commented on ANN-401:
--------------------------------------
yuk
I don't really know how to work around this one.
> @OrderBy does not work with inherited properties
> ------------------------------------------------
>
> Key: ANN-401
> URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-401
> Project: Hibernate Annotations
> Type: Bug
> Components: binder
> Versions: 3.2.0.cr1
> Environment: Hibernate 3.2, MySql 4, Windows XP
> Reporter: Guido Laures
>
>
> Using an @OrderBy with an inherited property produces an SQL Exception.
> Example:
> @Entity
> class Base {
> ...
> public int getPropertyForOrderBy(){ return propertytoOrderBy; }
> ...
> }
> @Entity
> @PrimaryKeyJoinColumn(name="a_id")
> class A extends Base {
> ...
> }
> @Entity
> @PrimaryKeyJoinColumn(name="b_id")
> class B extends Base {
> ...
> @OneToMany(mappedBy = "someProp", cascade = { CascadeType.ALL })
> @OrderBy("propertyToOrderBy")
> public Set<A> getASet() {
> return this.aSet;
> }
> ...
> }
> Thus, if A references a set of Bs and wants it to be ordered by a property of B's base class Base it crashes. The generated SQL string tries to find the property from the base class in the table of the inerited class (A) which fails.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
18 years, 4 months
[Hibernate-JIRA] Commented: (ANN-403) Improve Java 5 Enums dependency on old fashioned enums
by Emmanuel Bernard (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-403?page=co... ]
Emmanuel Bernard commented on ANN-403:
--------------------------------------
I guess I don't get it. How is it much better and more performant?
> Improve Java 5 Enums dependency on old fashioned enums
> ------------------------------------------------------
>
> Key: ANN-403
> URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-403
> Project: Hibernate Annotations
> Type: Improvement
> Versions: 3.2.0.cr1
> Reporter: Amir Pashazadeh
> Priority: Minor
>
> Original Estimate: 2 hours
> Remaining: 2 hours
>
> Converting from new enum types (like FlushModeType and CacheModeType) to old enum types (which is used by Query, Critiera, and ... interfaces) is not done well, and well formed.
> By adding constructors to new enums this could be much better, and more perform!
> I will attach what must have been done in FlushModeType, the same thing must happen to CacheModeType:
> public enum FlushModeType {
> /**
> * see {@link org.hibernate.FlushMode.ALWAYS}
> */
> ALWAYS(FlushMode.ALWAYS),
> /**
> * see {@link org.hibernate.FlushMode.AUTO}
> */
> AUTO(FlushMode.AUTO),
> /**
> * see {@link org.hibernate.FlushMode.COMMIT}
> */
> COMMIT(FlushMode.COMMIT),
> /**
> * see {@link org.hibernate.FlushMode.NEVER}
> */
> NEVER(FlushMode.NEVER);
> FlushModeType(FlushMode flushMode) {
> this.flushMode = flushMode;
> }
> private FlushMode flushMode;
> /**
> * @return old type proper FlushMode
> */
> public FlushMode getFlushMode() {
> return flushMode;
> }
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
18 years, 4 months