Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 339432

Summary: virtual attribute overrides in java are not validated
Product: [WebTools] Dali JPA Tools Reporter: Karen Butzke <karenfbutzke>
Component: JPAAssignee: Brian Vosburgh <brian.vosburgh>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: nan.n.li, neil.hauge
Version: 3.0   
Target Milestone: 3.1 M2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Karen Butzke CLA 2011-03-09 16:30:09 EST
This is similar to the problem with orm.xml virtual attributes not being validated. But this is in a purely Java case. You only get validation on attribute overrides if you specify them. If the EMPLOYEE.ZIP column does not exist, there is no validation error appearing on Employee.address. 

@Entity
public class Employee
  private Address address;
}

@Embeddable
public class Address {
    private int zip;
}
Comment 1 Nan Li CLA 2011-05-11 18:20:47 EDT
This problem also applies to mapped superclass:

@MappedSuperclass
public abstract class Foo {
	private String state;
	private String street1;
}

@Entity
@AttributeOverride(name = "state", column = @Column(name = "PROVINCE"))
public class Foo1 extends Foo {

}

If changing attribute "state" to something else in Foo, you would get a validation error on Foo1; however, you would NOT get a validation error on Foo1 against attribute "street1" even though no column named "STREET1" exists in the database.
Comment 2 Neil Hauge CLA 2011-05-11 19:20:04 EDT
This appears to be a regression and as such should be fixed in 3.0.
Comment 3 Nan Li CLA 2011-05-12 17:43:09 EDT
This is not only a bug for Java, but also for ORM.
Comment 4 Neil Hauge CLA 2011-05-18 21:29:16 EDT
Tried to get this fixed for RC2 but didn't have enough time.  Targeting to RC3 and will evaluate whether or not it is appropriate for RC3 when the fix is complete.
Comment 5 Neil Hauge CLA 2011-05-23 11:25:25 EDT
Given the normal severity of this bug, and the fact that the fix is likely to be a very large change, I am deferring this to 3.0.1.
Comment 6 Neil Hauge CLA 2011-07-01 16:25:25 EDT
Moving JPA specific bugs to new JPA component in bugzilla.
Comment 7 Neil Hauge CLA 2012-01-18 14:26:12 EST
This is fixed in head.  It seems unlikely that fixing this will be feasible in 3.0.x.
Comment 8 Neil Hauge CLA 2012-01-24 14:30:20 EST
Fixed in Dali 3.1.  Will only look at backport upon request.