<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings version="2.0" xmlns="http://java.sun.com/xml/ns/persistence/orm"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd">
	<package>org.apache.roller.weblogger.pojos</package>
	<entity metadata-complete="true" name="Weblog" class="org.apache.roller.weblogger.pojos.Weblog"
            access="PROPERTY">
		<table name="weblog"/>
		<named-query name="Weblog.getByHandle">
			<query>SELECT w FROM Weblog w WHERE w.handle = ?1</query>
		</named-query>
		<named-query name="Weblog.getByLetterOrderByHandle">
			<query>SELECT w FROM Weblog w WHERE UPPER(w.handle) like ?1 ORDER BY w.handle</query>
		</named-query>
		<named-query name="Weblog.getCountAllDistinct">
			<!-- DISTINCT is not required here -->
            <query>SELECT COUNT(w) FROM Weblog w</query>
		</named-query>
		<named-query name="Weblog.getCountByHandleLike">
			<query>SELECT COUNT(w) FROM Weblog w WHERE UPPER(w.handle) like ?1</query>
		</named-query>
		<attributes>
			<id name="id">
				<column name="id"/>
			</id>
			<basic name="handle">
				<column name="handle" insertable="true" updatable="true" unique="true"/>
			</basic>
			<basic name="about">
				<column name="about" insertable="true" updatable="true" unique="false"/>
			</basic>
			<basic name="iconPath">
				<column name="icon" insertable="true" updatable="true" unique="false"/>
			</basic>
			<basic name="name">
				<column name="name" insertable="true" updatable="true" unique="false"/>
			</basic>
			<basic name="tagline">
				<column name="tagline" insertable="true" updatable="true" unique="false"/>
			</basic>
			<basic name="enableBloggerApi">
				<column name="enablebloggerapi" insertable="true" updatable="true" unique="false"/>
			</basic>
			<basic name="editorPage">
				<column name="editorpage" insertable="true" updatable="true" unique="false"/>
			</basic>
			<basic name="blacklist">
				<column name="blacklist" insertable="true" updatable="true" unique="false"/>
			</basic>
            <basic name="analyticsCode">
                <column name="analyticscode" insertable="true" updatable="true" unique="false"/>
            </basic>
			<basic name="allowComments">
				<column name="allowcomments" insertable="true" updatable="true" unique="false"/>
			</basic>
			<basic name="defaultAllowComments">
				<column name="defaultallowcomments" insertable="true" updatable="true" unique="false"/>
			</basic>
			<basic name="defaultCommentDays">
				<column name="defaultcommentdays" insertable="true" updatable="true" unique="false"/>
			</basic>
			<basic name="moderateComments">
				<column name="commentmod" insertable="true" updatable="true" unique="false"/>
			</basic>
			<basic name="emailComments">
				<column name="emailcomments" insertable="true" updatable="true" unique="false"/>
			</basic>
			<basic name="emailAddress">
				<column name="emailaddress" insertable="true" updatable="true" unique="false"/>
			</basic>
			<basic name="editorTheme">
				<column name="editortheme" insertable="true" updatable="true" unique="false"/>
			</basic>
			<basic name="locale">
				<column name="locale" insertable="true" updatable="true" unique="false"/>
			</basic>
			<basic name="timeZone">
				<column name="timeZone" insertable="true" updatable="true" unique="false"/>
			</basic>
			<basic name="dateCreated">
				<column name="datecreated" insertable="true" updatable="true" unique="false"/>
				<temporal>TIMESTAMP</temporal>
			</basic>
            <basic name="defaultPlugins">
                <column name="defaultplugins" insertable="true" updatable="true" unique="false"/>
            </basic>
            <basic name="entryDisplayCount">
				<column name="displaycnt" insertable="true" updatable="true" unique="false"/>
			</basic>
			<basic name="visible">
				<column name="visible" insertable="true" updatable="true" unique="false"/>
			</basic>
			<basic name="active">
				<column name="isactive" insertable="true" updatable="true" unique="false"/>
			</basic>
			<basic name="creatorUserName">
				<column name="creator" insertable="true" updatable="true" unique="false"/>
			</basic>
			<basic name="lastModified">
				<column name="lastmodified" insertable="true" updatable="true" unique="false"/>
				<temporal>TIMESTAMP</temporal>
			</basic>
			<basic name="enableMultiLang">
				<column name="enablemultilang" insertable="true" updatable="true" unique="false"/>
			</basic>
			<basic name="showAllLangs">
				<column name="showalllangs" insertable="true" updatable="true" unique="false"/>
			</basic>
			<many-to-one name="bloggerCategory" target-entity="org.apache.roller.weblogger.pojos.WeblogCategory">
				<join-column name="bloggercatid" insertable="true" updatable="true"/>
			</many-to-one>
            <one-to-many name="weblogCategories" target-entity="org.apache.roller.weblogger.pojos.WeblogCategory" mapped-by="weblog">
                <order-by>position</order-by>
                <cascade>
                    <cascade-remove/>
                </cascade>
            </one-to-many>
            <one-to-many name="bookmarkFolders" target-entity="org.apache.roller.weblogger.pojos.WeblogBookmarkFolder" mapped-by="weblog">
                <cascade>
                    <cascade-persist/>
                    <cascade-remove/>
                </cascade>
            </one-to-many>
            <one-to-many name="mediaFileDirectories" target-entity="org.apache.roller.weblogger.pojos.MediaFileDirectory" mapped-by="weblog">
                <cascade>
                    <cascade-persist/>
                    <cascade-remove/>
                </cascade>
            </one-to-many>
			<transient name="theme"/>
			<transient name="creator"/>
			<transient name="absoluteURL"/>
			<transient name="commentCount"/>
			<transient name="commentModerationRequired"/>
			<transient name="todaysHits"/>
			<transient name="URL"/>
			<transient name="entryCount"/>
            <transient name="initializedPlugins"/>
            <transient name="localeInstance"/>
            <transient name="timeZoneInstance" />
		</attributes>
	</entity>
</entity-mappings>
