Bug 61 : PersistenceException in ... com.avaje.ebean.server.deploy.parse.JoinDefineManual.defineAssocOne
Priority 
High
Reported Version 
 
Logged By 
Rob
Status 
Fixed
Fixed Version 
1.0.3
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
23/01/2009
Updated 
23/01/2009
Type 
Bug
 
Attachments 
No attachments

Caused by: javax.persistence.PersistenceException: Could not find table [b_bug_priority] for app.data.Bug.app.data.Bug.priority
at com.avaje.ebean.server.deploy.parse.JoinDefineManual.defineAssocOne(JoinDefineManual.java:130)

 
Rob 23 Jan 10:08
Also can be seen as ...

Caused by: java.lang.NullPointerException
at com.avaje.ebean.server.deploy.parse.JoinDefineManual.defineAssocOne(JoinDefineManual.java:154)
at com.avaje.ebean.server.deploy.parse.JoinDefineManual.define(JoinDefineManual.java:67)
at com.avaje.ebean.server.deploy.parse.DeployUtil.define(DeployUtil.java:205)
at com.avaje.ebean.server.deploy.parse.AnnotationAssocOnes.readAssocOne(AnnotationAssocOnes.java:120)
at com.avaje.ebean.server.deploy.parse.AnnotationAssocOnes.parse(AnnotationAssocOnes.java:66)
at com.avaje.ebean.server.deploy.parse.ReadAnnotations.process(ReadAnnotations.java:37)

Rob 23 Jan 10:12
This can occur when ...

When you have entities defined for tables that can not be found (do not exist in the DB schema).

This can occur when you define a set of entities and want to use them across a number of DB schemas and not all the entities have a matching table in all the schemas.

Ebean should detect which entities do not have a matching DB table ... and just log a warning (and should not barf fatally).

This bug occurs when there are manual @JoinColumn type annotations on the entity bean... and in this case Ebean barfs rather than just logging the warning.

Rob 23 Jan 10:15
To Reproduce:

Find an Entity that has a manual table join on it ... change the base table to something that does not exist in the current DB schema

@Entity
@Table(name="no_such_table")
public class Comment {

...
@ManyToOne
@JoinColumn(name = "link_id")
CommentLink link;

Rob 24 Jan 02:08
Fixed in v1.0.3

Fixed in version 1.0.3

woResponse

Upload a file