Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 136379 - Missing table attribute processing results in error
Summary: Missing table attribute processing results in error
Status: CLOSED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: General (show other bugs)
Version: 0.5   Edit
Hardware: PC Windows XP
: P3 normal with 1 vote (vote)
Target Milestone: 0.5 M3   Edit
Assignee: Karen Butzke CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-12 12:49 EDT by Kevin Sutter CLA
Modified: 2007-03-14 18:21 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Sutter CLA 2006-04-12 12:49:44 EDT
Hi,
I had written a bug report (#136321) about missing attributes on the Persistence Panel.  One of them was the table attribute on the @Column annotation.  Since this seems to cause an error for me (and not just a missing panel attribute), I thought it was worth a separate defect.

When I attempt to identify a separate table for the @Column annotation, it doesn't seem like it's getting processed.  I am getting an error that it can't find the EMP_SAL column.  But, it's not looking in the EMP_SALARY table, it seems to be looking in the primary table for this Entity.

        @Column(table="EMP_SALARY", name="EMP_SAL")
	public Long getSalary() {
		return salary;
	}
	public void setSalary(Long salary) {
		this.salary = salary;
	}

Severity	Description	Resource	In Folder	Location	Creation Time	Id
2	Column "EMP_SAL" cannot be resolved	Employee.java	jpa.dali/src/com/ibm/ws/persistence/spec/complex	line 0	April 12, 2006 11:32:33 AM	20961

Let me know if you need any additional data.

Thanks,
Kevin
Comment 1 Karen Butzke CLA 2006-04-13 09:58:51 EDT
I'm trying to decide if this is an enhancement request or a bug, but since it does cause an error we can probably leave it as a bug.  We don't currently support SecondaryTables, so that would be the enhancement request part. 

I am not positive on how the spec handles this.  To define the table attribute on the @Column, does it have to match one of your SecondaryTables(or primary table), or is this another way to handle multiple tables for an Entity?  Basically, I am wondering if it would be an error condition to specify a table on the Column annotation that isn't specified on the Entity, or if it implies a SecondaryTable defined with the default joinColumns.
Comment 2 Kevin Sutter CLA 2006-04-13 10:51:44 EDT
Karen,
Good question.  My interpretation of the JPA spec is that the "table" attribute should reference one of the SecondaryTables defined for the Entity.  So, if you don't support SecondaryTables at this time, then that would explain the error that I am seeing.  If you want (or need) to change this to an enhancement, that would be okay with me.

Thanks,
Kevin
Comment 3 Kevin Sutter CLA 2006-04-13 12:13:52 EDT
FYI...  Just got clarification from the EJB3 Expert Group that the "table" attribute in the @Column annotation must, in fact, assume that the secondary table is already defined and should not cause it to be defined.
Comment 4 Karen Butzke CLA 2006-04-13 12:27:33 EDT
Cool, we can hope we didn't give them any ideas for more defaults :)
Comment 5 Karen Butzke CLA 2006-04-23 12:03:07 EDT
Fixed the situation for Column annotations.  

Also need to fix it for JoinColumns, JoinColumns in JoinTable, and AttributeOverrides
Comment 6 Karen Butzke CLA 2006-04-24 14:50:31 EDT
fixed for joinColumns and attributeOverrides
Comment 7 Kevin Sutter CLA 2006-05-18 12:41:01 EDT
Looks good.  Thanks.
Comment 8 Neil Hauge CLA 2007-03-14 18:21:36 EDT
Closing Verified Fixed bugs from 0.5.