Hi Andrei,
fullName is a basic mapping so you'll need:
<basic name="fullName">
<column name="FULL_NAME"/>
</basic>
It's defaulting to Basic when you use annotations. And in Java you
have the field declaration to attach the @Column to, but in XML you need
to provide the <basic> element so you have some context for the nested
the <column> element.
Shaun
Andrei Badea wrote:
> I seem to be missing something obvious, but which element in orm.xml
> corresponds to the @Column annotation? For example, how would the
> fullName property in the following example be mapped with XML?
>
> @Entity
> public class Customer {
>
> @Id
> @Column(name = "ID", nullable = false)
> private Integer id;
>
> @Column(name = "FULL_NAME", length = 20, nullable = false)
> private String fullName;
> }
>
> I would expect something like
>
> <entity-mappings>
> <entity>
> <attributes>
> <id name="id">
> <column name="ID" nullable="false"/>
> </id>
> <!-- map the fullName property here -->
> </attributes>
> </entity>
> </entity-mappings>
>
> but I don't know which element to use to map the FULL_NAME property.
> The spec allows basic, version, embedded, transient and the
> relationship elements. None of these seems to be the right one.
>
> Thanks,
>
> Andrei
--
Shaun Smith
Principal Product Manager
Oracle TopLink
shaun.smith_at_oracle.com