Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 733435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:15:26+00:00 2026-05-14T07:15:26+00:00

I am using Ejb3 and JPA (based on Hibernate and Oracle 10g at the

  • 0

I am using Ejb3 and JPA (based on Hibernate and Oracle 10g at the moment)

I have an entity that contains a clob

@Entity
@Table(name = "My_TAB")
public class ExampleEntity implements java.io.Serializable {

    private Clob someText;

    public void setSomeText(Clob someText) {
        this.someText= someText;
    }

    @Column(name = "COLUMN_NAME")
    public Clob getSomeText() {
        return this.someText;
    }

Then I want to save an entity of this type.

At the moment I am doing the following which works perfectly

ExampleEntity exampleEntity = new ExampleEntity();
exampleEntity.setSomeText(Hibernate.createClob(aStringValue));
someOtherDao.save(exampleEntity);

However this ties my code to Hibernate! I have specifically avoided so far Hibernate extensions and used only JPA annotations. The code works because indeed Hibernate is my current implementation.

Is there some sort of JPA API that allows me to create a clob in a generic way? So if later I decide to switch to Toplink/EclipseLink or something else I won’t have to change a thing?

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T07:15:26+00:00Added an answer on May 14, 2026 at 7:15 am

    There’s such an example is the JPA spec (§ 9.1.5)

    @Column(name="DESC", 
    columnDefinition="CLOB NOT NULL", 
    table="EMP_DETAIL") 
    @Lob 
    public String getDescription() { return description; }
    

    I believe it’s the standard way for CLOB.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to JPA/Hibernate. Currently using EJB3, Hibernate/JPA. I have an inheritacnce structure
I have been using Hibernate ORM, which is an implementation of the JPA specification
I have application written in Java that is using EJB3 + Toplink. I'm using
I would like to specify JNDI name for an EJB3 bean using annotation, but
I try to build simple Java EE application that uses JPA + EJB3 and
I have a web service (built using jaxb/jaxws) that invokes a stateless EJB to
I have the following JPA entity classes (example case). A House belongs on a
using Jboss5.1.x, EJB3.0, JPA. Is there a way of running a query with DBLINK
I am using Weblogic 116, Ejb3.0 , quartz-all 1.8.5. I have issues with quartz
I have successfully used hibernate3-maven-plugin with Hibernate-Core and EntityManager 3.6.6-FINAL, hibernate-commons-annotations-3.2.0.Final, hibernate-jpa-2.0-api-1.0.1.Final and hibernate-validator-4.0.0.GA

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.