-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: how to show database field with hibernate metadata
PostPosted: Mon Jul 28, 2008 3:22 am 
Newbie

Joined: Sat Jul 26, 2008 3:54 am
Posts: 2
Location: Jakarta
Hai all,
i'm a newbie in hibernate..
now i've a problem with hibernate.

how to show database field in my application with hibernate.

nowadays, i've a POJO class in my program

Code:
package org.blueoxygen.aconix.entity;

import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.Table;
import javax.persistence.InheritanceType;

import org.blueoxygen.cimande.DefaultPersistence;

/**
* @author SiLeNT~SkY
*
*/
@Entity()
@Table(name="article")
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
public class Article extends DefaultPersistence {
   
   private String title;
   private String abstract;
   private String Description;

   // getter and setter for entity
}


I'm using POJO to generate database.
and my problem now is how to take the field from database.
because my field's name is different with the entity's name in POJO.

when i'm trying to search in browser, i've found metadata in package org.hibernate.metadata , but i dont know how to use it.

anyone can help me?
Thank you


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 28, 2008 7:06 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Quote:
how to show database field in my application with hibernate.


I'm not sure what you're trying to do?

Are you trying to read from the database? Or do you want to get the name of the column in the table that was created by Hibernate?

If you're having problems with basic create/read/update,delete operations, take a look at this free set of Hibernate tutorials:

How to Perform Basic CRUD Operations with Hibernate: A Tutorial

Post back!

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 28, 2008 8:02 am 
Newbie

Joined: Sat Jul 26, 2008 3:54 am
Posts: 2
Location: Jakarta
in my case, i want to try read the column in the table that was created by hibernate.

i want my application can read the column in the table.

thx


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.