|
|
|
Re: orm.xml - customizing table name [message #740675 is a reply to message #740493] |
Tue, 18 October 2011 19:21 |
Mauro Flores Messages: 84 Registered: September 2009 Location: Brasil |
Member |
|
|
Thanks, Chris. It almost worked.
Unfortunally two annottations were ignored:
1) @Temporal
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "DATA_HORA")
private Calendar dataHora;
Exception Description: The attribute [dataHora] from the entity class [class X] does not specify a temporal type. A temporal type must be specified for persistent fields or properties of type java.util.Date and java.util.Calendar.
at org.eclipse.persistence.exceptions.ValidationException.noTemporalTypeSpecified(ValidationException.java:1375)
2) @Id
@Id
@Column(name = "NRO_INT_AUDITORIA")
private Long nroIntAuditoria;
Exception Description: Entity class [class X] has no primary key specified. It should define either an @Id, @EmbeddedId or an @IdClass. If you have defined PK using any of these annotations then make sure that you do not have mixed access-type (both fields and properties annotated) in your entity class hierarchy.
I will try now to define this two information redundantly in orm.xml:
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
version="1.0">
<entity name="EntityName" class="X"
access="PROPERTY">
<table name="TABLE" />
<attributes>
<id name="nroIntAuditoria"></id>
<basic name="dataHora"><temporal>TIMESTAMP</temporal></basic>
</attributes>
</entity>
</entity-mappings>
[Updated on: Tue, 18 October 2011 19:22] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05093 seconds