<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>By Programmer For Programmer &#187; hibernate</title>
	<atom:link href="http://byprogrammerforprogrammer.com/tag/hibernate/feed/" rel="self" type="application/rss+xml" />
	<link>http://byprogrammerforprogrammer.com</link>
	<description>Here I lay down the useful tips, tricks and utilities for programmers like myself.</description>
	<lastBuildDate>Fri, 02 Apr 2010 16:58:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Hibernate: Get Table Name from Mapped Class</title>
		<link>http://byprogrammerforprogrammer.com/2009/10/hibernate-get-table-name-from-mapped-class/</link>
		<comments>http://byprogrammerforprogrammer.com/2009/10/hibernate-get-table-name-from-mapped-class/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 20:44:05 +0000</pubDate>
		<dc:creator>Sean Adkinson</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://byprogrammerforprogrammer.com/?p=29</guid>
		<description><![CDATA[Given a class mapped in Hibernate, use this code to get the table name.]]></description>
			<content:encoded><![CDATA[<p>Given a class that is mapped in Hibernate, you can get the table name that it is mapped to with the following piece of code.</p>
<pre>
import org.hibernate.SessionFactory;
import org.hibernate.persister.entity.Joinable;

public String getTableName(SessionFactory sessionFactory, Class&lt;?&gt; mappedClass)
{
    ClassMetadata cmd = sessionFactory.getClassMetadata(mappedClass);

    //check that the class is mapped to something with a table name
    if (cmd == null || !Joinable.class.isInstance(cmd))
        return null;

    return Joinable.class.cast(cmd).getTableName();
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://byprogrammerforprogrammer.com/2009/10/hibernate-get-table-name-from-mapped-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
