Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Problem with column data type when using Converters (column data type converter problem)
Problem with column data type when using Converters [message #554553] Mon, 23 August 2010 10:19 Go to previous message
Mik is currently offline Mik
Messages: 3
Registered: August 2010
Junior Member
Hello Forum,

I have a problem with EclipseLink.

I want to persist object attributes with a converter like in the following example:

@Entity
@Converter(
	converterClass=ConverterJTextAreaToString.class,
	name="ConverterJTextAreaToString"
)
public class MyEntity {
	@Convert("ConverterJTextAreaToString")
	@Column(name = "MY_TEXT", nullable=true, length=4000)
	private JTextArea myTextArea;

	public JTextArea getMyTextArea) {
		return myTextArea;
	}
}


In principle this works fine.
However, I also generate my tables with JPA (eclipselink.ddl-generation = create-tables), and whenever I use Converters JPA creates the columns as of type varchar with a length of 255.
The length attribute in the @Column annotation is just ignored, as well as the Java data type returned by the Converter.

Does anyone know how to set the data type with its attribute for a column when using a Converter?

Regards,
Mik

[Updated on: Mon, 23 August 2010 10:23]

Report message to a moderator

 
Read Message
Read Message
Previous Topic:Two entity manager appointing to the same daba base
Next Topic:NullPointerException in class ObjectReferenceMapping
Goto Forum:
  


Current Time: Sat May 25 09:08:43 EDT 2013

Powered by FUDForum. Page generated in 0.01662 seconds