<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    JPA validation fails
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/jskovjyskebankdk">Jesper Skov</a> in <i>JBoss Tools</i> - <a href="https://community.jboss.org/message/720006#720006">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hi,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span>I just closed an issue I created against Dali: </span><a class="jive-link-external-small" href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=372478" target="_blank">https://bugs.eclipse.org/bugs/show_bug.cgi?id=372478</a><span> (I included the text below)</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>It appears that the JPA validation error (Column "attributes" cannot be found on table...) we get is due to a problem in JBoss Tools, Hibernate.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I wonder if we need to "do something" to make the validation pass, or it is indeed a bug. We can disable the validation as a workaround, but would like it working, obviously.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>The reason I ask, is that it seems such an obvious problem, and I can't find anything currently open (or closed) in Jira to explain it.</p><p>We see it in more than one class. Maybe it's just a problem with the coding style here <span> :^0 </span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>On the other hand, switching the JPA platform to Generic fixes the problem, so maybe not.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I just tried the JBoss Tools nightly build from yesterday (on 3.7sr2) and could still reproduce.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Is it something I should file a Jira issue for?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Thx,</p><p>Jesper</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>------ from the closed Eclipse issue -------</p><p>Build Identifier: Build id: 20120216-1857</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>We see a false error from the validation rule: Database/Column/Column cannot be</p><p>resolved.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>The class with the validation error is this:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>@Entity</p><p>@Table(name = "PasswordResourceAuditLog", uniqueConstraints =</p><p>@UniqueConstraint(columnNames = { "timestamp" }))</p><p>public class PasswordResourceAuditLogEntry extends UUIDEntity implements</p><p>LogEntry, Serializable {</p><p>&#160;&#160;&#160; @Column(length = 50)</p><p>&#160;&#160;&#160; private String username;</p><p>&#160;&#160;&#160; private String dataSourceName;</p><p>&#160;&#160;&#160; @Temporal(TemporalType.TIMESTAMP)</p><p>&#160;&#160;&#160; private Date timestamp;</p><p>&#160;&#160;&#160; @OneToOne(fetch=FetchType.EAGER)</p><p>&#160;&#160;&#160; private PasswordAttributes attributes;</p><p>...</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>The field attributes gets a validation error:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Column "attributes" cannot be resolved on table "PASSWORDRESOURCEAUDITLOG"</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>The class PasswordAttributes looks like this:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)</p><p>@Entity</p><p>abstract public class PasswordAttributes extends UUIDEntity {</p><p>&#160;&#160;&#160; public abstract PasswordAttributes copy();</p><p>&#160;&#160;&#160; public abstract PasswordType getType();</p><p>&#160;&#160;&#160; public void setType(PasswordType type){</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; //dummy method due to EL</p><p>&#160;&#160;&#160; }&#160;&#160;&#160; </p><p>}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>and in turn:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>@MappedSuperclass</p><p>public class UUIDEntity implements Serializable {</p><p>&#160;&#160;&#160; @Id @GeneratedValue(generator="system-uuid")</p><p>&#160;&#160;&#160; @GenericGenerator(name="system-uuid",strategy = "uuid")&#160;&#160;&#160; </p><p>&#160;&#160;&#160; @Column(length=32)</p><p>&#160;&#160;&#160; @Size(max=32, min=32)</p><p>&#160;&#160;&#160; protected String id;</p><p>&#160;&#160;&#160; @SuppressWarnings("unused")</p><p>&#160;&#160;&#160; @Version</p><p>&#160;&#160;&#160; private Long version;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160; public String getId() {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; return id;</p><p>&#160;&#160;&#160; }</p><p>}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Looking in the database (tables created by Hibernate, no custom configuration</p><p>as far as I know), the column is actually called ATTRIBUTES_ID.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>We would expect the validator to look for this, not a column named ATTRIBUTES.</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/720006#720006">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Tools at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2128">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>