Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] SecondaryTable question

Eclipselink version: 2.0.0
 
Is it possible to use a secondary table in such a way that inserts/updates happen only to the primary table?
 
You are probably wondering “Why on earth would you want that behavior”.  Here’s why.  We are using the @SecondaryTable annotation to point to a view which contains read-only data.
 
@Table(name=”REGISTRATIONS”)
@SecondaryTable(name=”REGISTRATION_STATUS_FLAGS_V)
public class Registration {
  ...
  @Column(name=”EXPIRATION_STATUS”
          table=”REGISTRATION_STATUS_FLAGS_V”
          insertable=”false”
          updatable=”false”)
  private String expirationStatus;
}
 
The current setup is resulting in database errors because an insert to the primary table results in an attempted insert to the secondary table as well.
 
Sri
 

Back to the top