Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Java Persistence String length

843830Nov 19 2007
Hi I am currently trying to store large strings using Java Persistence. I have found the annotation @Column(length=20000)
which increase the length of the string from 255 to the specified amount. The problem is that when I increase the value in excess of 50000 characters Java Persistence fails to create the table. The entity class is shown below.

@Entity
public class SubmittedFile implements Serializable {

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;

@Column(length=20000)
private String fileText;

......

}


1. Is there any way of mapping a String to a unlimited data type, so I don't have to specify a length?
2. If not is there any way of increasing the length attribute above 50000 characters?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 17 2007
Added on Nov 19 2007
0 comments
355 views