Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » EclipseLink + Apache Derby(Problems to mapping StringProperty)
EclipseLink + Apache Derby [message #1786255] Fri, 27 April 2018 19:46 Go to next message
Ernesto Andres Zapata Icart is currently offline Ernesto Andres Zapata IcartFriend
Messages: 2
Registered: April 2018
Junior Member
Hi, I'n newbie in ORM discussions....but I have a problem with one properties defined in my model class: Categoria...here it is:
------------------
@Entity
@Table(name = "APP.CATEGORIAS")
@NamedQueries({ @NamedQuery(name = "Categorias.buscarTodas", query = "select c from APP.CATEGORIAS c")
})
public class Categoria {
@Id
@SequenceGenerator(name = "SEQ_CAT", initialValue = 1, allocationSize = 53)
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_CAT")
@Column(name = "IDCATEGORIA", nullable = false)
private final IntegerProperty idcategoria;
@Column(name = "CODIGO", length = 10, nullable = false)
private StringProperty codigo;
@Column(name = "DESCRIPCION", length = 150, nullable = true)
private StringProperty descripcion;
-----------
The column is "descripcion" ...this is the table in Derby:
CREATE TABLE APP.CATEGORIAS (
IDCATEGORIA INTEGER DEFAULT AUTOINCREMENT: start 1 increment 1 NOT NULL,
CODIGO VARCHAR(10) NOT NULL,
DESCRIPCION VARCHAR(150),
CONSTRAINT CATEGORIAS_PK PRIMARY KEY (IDCATEGORIA)
) ;
----------------------
This is my persistence.xml:
<persistence-unit name="balthusPU" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>

<class>ar.dignitas.balthus.model.Categoria</class>

<properties>
<property name="javax.persistence.jdbc.driver" value="org.apache.derby.jdbc.ClientDriver40" />
<property name="javax.persistence.jdbc.url" value="jdbc:derby://localhost:1527/C:\Sistemas\data\balthus;create=false" />
<property name="javax.persistence.jdbc.user" value="app" />
<property name="javax.persistence.jdbc.password" value="app" />
<property name="eclipselink.logging.level" value="ALL"/>
<!-- <property name="eclipselink.ddl-generation" value="drop-and-create-tables" /> -->
<!-- <property name="eclipselink.ddl-generation.output-mode" value="database" /> -->
</properties>
</persistence-unit>
</persistence>
------------
When I try to run my SE application the next erro appear:
The type [class javafx.beans.property.StringProperty] for the attribute [descripcion] on the entity class [class ar.dignitas.balthus.model.Categoria] is not a valid type for a serialized mapping. The attribute type must implement the Serializable interface.
---------
I don't know why ...any helps?
TIA
Re: EclipseLink + Apache Derby [message #1786357 is a reply to message #1786255] Wed, 02 May 2018 00:10 Go to previous messageGo to next message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1305
Registered: July 2009
Senior Member
The error states the problem - StringProperty isn't something understood by JPA as it isn't a basic type. Try using String instead, or create a converter for it.
Re: EclipseLink + Apache Derby [message #1786380 is a reply to message #1786357] Wed, 02 May 2018 11:49 Go to previous message
Ernesto Andres Zapata Icart is currently offline Ernesto Andres Zapata IcartFriend
Messages: 2
Registered: April 2018
Junior Member
Thank you Chris!
Previous Topic:Multi tenancy with schema per tenant and ids by sequence
Next Topic:Static weaving with Base Entity class in a seperate jar fails
Goto Forum:
  


Current Time: Mon Nov 19 22:16:28 GMT 2018

Powered by FUDForum. Page generated in 0.02113 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top