This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 96595 - GenBeans doesn't generate code for unique key references
Summary: GenBeans doesn't generate code for unique key references
Status: NEW
Alias: None
Product: ide
Classification: Unclassified
Component: Schema2Beans (show other bugs)
Version: 4.x
Hardware: All All
: P3 blocker (vote)
Assignee: schema2beans-issues@ide
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-26 15:32 UTC by yaminikb
Modified: 2008-12-10 11:05 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description yaminikb 2007-02-26 15:32:36 UTC
Unique key references is not working. For the following definitions in schema

 <xs:keyref name="default-virtual-server-nameKeyref" refer="virtual-server-nameKey">
    <xs:annotation>
      <xs:documentation>
        &lt;default-virtual-server-name> must refer to an existing
&lt;virtual-server>.
      </xs:documentation>
    </xs:annotation>
    <xs:selector xpath="http-listener"/>
    <xs:field xpath="default-virtual-server-name"/>
  </xs:keyref>

<xs:keyref name="http-listener-nameKeyref" refer="http-listener-nameKey">
    <xs:annotation>
      <xs:documentation>
        &lt;http-listener-name> must refer to an existing &lt;http-listener>.
      </xs:documentation>
    </xs:annotation>
    <xs:selector xpath="virtual-server"/>
    <xs:field xpath="http-listener-name"/>
  </xs:keyref>
</xs:element>

Sample elements as follows:

<http-listener>
  <name>http-listener-1</name>
  <port>2222</port>
  <server-name>syrinx</server-name>
  <default-virtual-server-name>sample</default-virtual-server-name>
</http-listener>

<virtual-server>
  <name>sample</name>
  <host>syrinx</host>
  <http-listener-name>http-listener-1</http-listener-name>
</virtual-server>

For example changing default-virtual-server-name value to say "foo" (which does
not exist) via the generated bean works without any error. So, basically no code
is being generated for validating keyrefs.
Comment 1 Erno Mononen 2007-03-23 10:01:31 UTC
I'd consider this to be an enhancement request, it is a feature that is 
currently not implemented in s2b.