ranger數據庫框架使用

ranger使用的jpa

  1、Spring-data-jpa的基本介紹:JPA誕生的緣由是爲了整合第三方ORM框架,建立一種標準的方式,百度百科說是JDK爲了實現ORM的天下歸一,目前也是在按照這個方向發展,但是還沒能完全實現。在ORM框架中,Hibernate是一支很大的部隊,使用很廣泛,也很方便,能力也很強,同時Hibernate也是和JPA整合的比較良好,我們可以認爲JPA是標準,事實上也是,JPA幾乎都是接口,實現都是Hibernate在做,宏觀上面看,在JPA的統一之下Hibernate很良好的運行。

  上面闡述了JPA和Hibernate的關係,那麼Spring-data-jpa又是個什麼東西呢?這地方需要稍微解釋一下,我們做Java開發的都知道Spring的強大,到目前爲止,企業級應用Spring幾乎是無所不能,無所不在,已經是事實上的標準了,企業級應用不使用Spring的幾乎沒有,這樣說沒錯吧。而Spring整合第三方框架的能力又很強,他要做的不僅僅是個最早的IOC容器這麼簡單一回事,現在Spring涉及的方面太廣,主要是體現在和第三方工具的整合上。而在與第三方整合這方面,Spring做了持久化這一塊的工作,我個人的感覺是Spring希望把持久化這塊內容也拿下。於是就有了Spring-data-**這一系列包。包括,Spring-data-jpa,Spring-data-template,Spring-data-mongodb,Spring-data-redis,還有個民間產品,mybatis-spring,和前面類似,這是和mybatis整合的第三方包,這些都是乾的持久化工具乾的事兒。

  這裏介紹Spring-data-jpa,表示與jpa的整合。

  2、我們都知道,在使用持久化工具的時候,一般都有一個對象來操作數據庫,在原生的Hibernate中叫做Session,在JPA中叫做EntityManager,在MyBatis中叫做SqlSession,通過這個對象來操作數據庫。我們一般按照三層結構來看的話,Service層做業務邏輯處理,Dao層和數據庫打交道,在Dao中,就存在着上面的對象。那麼ORM框架本身提供的功能有什麼呢?答案是基本的CRUD,所有的基礎CRUD框架都提供,我們使用起來感覺很方便,很給力,業務邏輯層面的處理ORM是沒有提供的,如果使用原生的框架,業務邏輯代碼我們一般會自定義,會自己去寫SQL語句,然後執行。在這個時候,Spring-data-jpa的威力就體現出來了,ORM提供的能力他都提供,ORM框架沒有提供的業務邏輯功能Spring-data-jpa也提供,全方位的解決用戶的需求。使用Spring-data-jpa進行開發的過程中,常用的功能,我們幾乎不需要寫一條sql語句,至少在我看來,企業級應用基本上可以不用寫任何一條sql,當然spring-data-jpa也提供自己寫sql的方式,這個就看個人怎麼選擇,都可以。我覺得都行。  

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:p="http://www.springframework.org/schema/p" 
    xmlns:aop="http://www.springframework.org/schema/aop" 
    xmlns:tx="http://www.springframework.org/schema/tx" 
    xmlns:context="http://www.springframework.org/schema/context" 
    xmlns:mongo="http://www.springframework.org/schema/data/mongo"
    xmlns:jpa="http://www.springframework.org/schema/data/jpa"
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
           http://www.springframework.org/schema/aop     
           http://www.springframework.org/schema/aop/spring-aop-3.0.xsd   
           http://www.springframework.org/schema/tx
           http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
           http://www.springframework.org/schema/context     
           http://www.springframework.org/schema/context/spring-context-3.0.xsd
           http://www.springframework.org/schema/data/mongo
           http://www.springframework.org/schema/data/mongo/spring-mongo-1.0.xsd
           http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd">

    <!-- 數據庫連接 -->
    <context:property-placeholder location="classpath:your-config.properties" ignore-unresolvable="true" />
    <!-- service包 -->
    <context:component-scan base-package="your service package" />
    <!-- 使用cglib進行動態代理 -->
    <aop:aspectj-autoproxy proxy-target-class="true" />
    <!-- 支持註解方式聲明式事務 -->
    <tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true" />
    <!-- dao -->
    <jpa:repositories base-package="your dao package" repository-impl-postfix="Impl" entity-manager-factory-ref="entityManagerFactory" transaction-manager-ref="transactionManager" />
    <!-- 實體管理器 -->
    <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
        <property name="dataSource" ref="dataSource" />
        <property name="packagesToScan" value="your entity package" />
        <property name="persistenceProvider">
            <bean class="org.hibernate.ejb.HibernatePersistence" />
        </property>
        <property name="jpaVendorAdapter">
            <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
                <property name="generateDdl" value="false" />
                <property name="database" value="MYSQL" />
                <property name="databasePlatform" value="org.hibernate.dialect.MySQL5InnoDBDialect" />
                <!-- <property name="showSql" value="true" /> -->
            </bean>
        </property>
        <property name="jpaDialect">
            <bean class="org.springframework.orm.jpa.vendor.HibernateJpaDialect" />
        </property>
        <property name="jpaPropertyMap">
            <map>
                <entry key="hibernate.query.substitutions" value="true 1, false 0" />
                <entry key="hibernate.default_batch_fetch_size" value="16" />
                <entry key="hibernate.max_fetch_depth" value="2" />
                <entry key="hibernate.generate_statistics" value="true" />
                <entry key="hibernate.bytecode.use_reflection_optimizer" value="true" />
                <entry key="hibernate.cache.use_second_level_cache" value="false" />
                <entry key="hibernate.cache.use_query_cache" value="false" />
            </map>
        </property>
    </bean>
    
    <!-- 事務管理器 -->
    <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
        <property name="entityManagerFactory" ref="entityManagerFactory"/>
    </bean>
    
    <!-- 數據源 -->
    <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close">
        <property name="driverClassName" value="${driver}" />
        <property name="url" value="${url}" />
        <property name="username" value="${userName}" />
        <property name="password" value="${password}" />
        <property name="initialSize" value="${druid.initialSize}" />
        <property name="maxActive" value="${druid.maxActive}" />
        <property name="maxIdle" value="${druid.maxIdle}" />
        <property name="minIdle" value="${druid.minIdle}" />
        <property name="maxWait" value="${druid.maxWait}" />
        <property name="removeAbandoned" value="${druid.removeAbandoned}" />
        <property name="removeAbandonedTimeout" value="${druid.removeAbandonedTimeout}" />
        <property name="timeBetweenEvictionRunsMillis" value="${druid.timeBetweenEvictionRunsMillis}" />
        <property name="minEvictableIdleTimeMillis" value="${druid.minEvictableIdleTimeMillis}" />
        <property name="validationQuery" value="${druid.validationQuery}" />
        <property name="testWhileIdle" value="${druid.testWhileIdle}" />
        <property name="testOnBorrow" value="${druid.testOnBorrow}" />
        <property name="testOnReturn" value="${druid.testOnReturn}" />
        <property name="poolPreparedStatements" value="${druid.poolPreparedStatements}" />
        <property name="maxPoolPreparedStatementPerConnectionSize" value="${druid.maxPoolPreparedStatementPerConnectionSize}" />
        <property name="filters" value="${druid.filters}" />
    </bean>
    
    <!-- 事務 -->
    <tx:advice id="txAdvice" transaction-manager="transactionManager">
        <tx:attributes>
            <tx:method name="*" />
            <tx:method name="get*" read-only="true" />
            <tx:method name="find*" read-only="true" />
            <tx:method name="select*" read-only="true" />
            <tx:method name="delete*" propagation="REQUIRED" />
            <tx:method name="update*" propagation="REQUIRED" />
            <tx:method name="add*" propagation="REQUIRED" />
            <tx:method name="insert*" propagation="REQUIRED" />
        </tx:attributes>
    </tx:advice>
    <!-- 事務入口 -->
    <aop:config>
        <aop:pointcut id="allServiceMethod" expression="execution(* your service implements package.*.*(..))" />
        <aop:advisor pointcut-ref="allServiceMethod" advice-ref="txAdvice" />
    </aop:config>

</beans>

  2.2對上面的配置文件進行簡單的解釋,只對“實體管理器”和“dao”進行解釋,其他的配置在任何地方都差不太多。

    1.對“實體管理器”解釋:我們知道原生的jpa的配置信息是必須放在META-INF目錄下面的,並且名字必須叫做persistence.xml,這個叫做persistence-unit,就叫做持久化單元,放在這下面我們感覺不方便,不好,於是Spring提供了

org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean

這樣一個類,可以讓你的隨心所欲的起這個配置文件的名字,也可以隨心所欲的修改這個文件的位置,只需要在這裏指向這個位置就行。然而更加方便的做法是,直接把配置信息就寫在這裏更好,於是就有了這實體管理器這個bean。使用

<property name="packagesToScan" value="your entity package" />

這個屬性來加載我們的entity。

  2.3 解釋“dao”這個bean。這裏衍生一下,進行一下名詞解釋,我們知道dao這個層叫做Data Access Object,數據庫訪問對象,這是一個廣泛的詞語,在jpa當中,我們還有一個詞語叫做Repository,這裏我們一般就用Repository結尾來表示這個dao,比如UserDao,這裏我們使用UserRepository,當然名字無所謂,隨意取,你可以意會一下我的意思,感受一下這裏的含義和區別,同理,在mybatis中我們一般也不叫dao,mybatis由於使用xml映射文件(當然也提供註解,但是官方文檔上面表示在有些地方,比如多表的複雜查詢方面,註解還是無解,只能xml),我們一般使用mapper結尾,比如我們也不叫UserDao,而叫UserMapper。

  上面拓展了一下關於dao的解釋,那麼這裏的這個配置信息是什麼意思呢?首先base-package屬性,代表你的Repository接口的位置,repository-impl-postfix屬性代表接口的實現類的後綴結尾字符,比如我們的UserRepository,那麼他的實現類就叫做UserRepositoryImpl,和我們平時的使用習慣完全一致,於此同時,spring-data-jpa的習慣是接口和實現類都需要放在同一個包裏面(不知道有沒有其他方式能分開放,這不是重點,放在一起也無所謂,影響不大),再次的,這裏我們的UserRepositoryImpl這個類的定義的時候我們不需要去指定實現UserRepository接口,根據spring-data-jpa自動就能判斷二者的關係。

  比如:我們的UserRepository和UserRepositoryImpl這兩個類就像下面這樣來寫。

public interface UserRepository extends JpaRepository<User, Integer>{}
public class UserRepositoryImpl {}

  那麼這裏爲什麼要這麼做呢?原因是:spring-data-jpa提供基礎的CRUD工作,同時也提供業務邏輯的功能(前面說了,這是該框架的威力所在),所以我們的Repository接口要做兩項工作,繼承spring-data-jpa提供的基礎CRUD功能的接口,比如JpaRepository接口,同時自己還需要在UserRepository這個接口中定義自己的方法,那麼導致的結局就是UserRepository這個接口中有很多的方法,那麼如果我們的UserRepositoryImpl實現了UserRepository接口,導致的後果就是我們勢必需要重寫裏面的所有方法,這是Java語法的規定,如此一來,悲劇就產生了,UserRepositoryImpl裏面我們有很多的@Override方法,這顯然是不行的,結論就是,這裏我們不用去寫implements部分。

  spring-data-jpa實現了上面的能力,那他是怎麼實現的呢?這裏我們通過源代碼的方式來呈現他的來龍去脈,這個過程中cglib發揮了傑出的作用。

  在spring-data-jpa內部,有一個類,叫做

public class SimpleJpaRepository<T, ID extends Serializable> implements JpaRepository<T, ID>,
        JpaSpecificationExecutor<T>

我們可以看到這個類是實現了JpaRepository接口的,事實上如果我們按照上面的配置,在同一個包下面有UserRepository,但是沒有UserRepositoryImpl這個類的話,在運行時期UserRepository這個接口的實現就是上面的SimpleJpaRepository這個接口。而如果有UserRepositoryImpl這個文件的話,那麼UserRepository的實現類就是UserRepositoryImpl,而UserRepositoryImpl這個類又是SimpleJpaRepository的子類,如此一來就很好的解決了上面的這個不用寫implements的問題。我們通過閱讀這個類的源代碼可以發現,裏面包裝了entityManager,底層的調用關係還是entityManager在進行CRUD。

ranger 的applycationContext.xml

<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->



<beans default-lazy-init="true" xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context"
xmlns:task="http://www.springframework.org/schema/task" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-3.2.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task-3.2.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd">

	<context:component-scan base-package="org.apache.ranger" >
		<!-- context:exclude-filter type="regex" expression="org.apache.ranger\.common\.db\.DaoManager" / -->
	</context:component-scan>
	<context:component-scan base-package="org.apache.ranger" />
	<tx:annotation-driven />

	<bean id="defaultEntityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
		<property name="persistenceUnitName" value="defaultPU" />
		<property name="dataSource" ref="dataSource" />
		<property name="jpaVendorAdapter">
			<bean class="org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter">
				<property name="databasePlatform" value="${ranger.jpa.jdbc.dialect}" />
				<property name="showSql" value="${ranger.jpa.showsql}" />
				<property name="generateDdl" value="false" />
			</bean>
		</property>
		<property name="jpaPropertyMap">
			<props>
				<prop key="eclipselink.weaving">false</prop>
			</props>
		</property>
		<property name="loadTimeWeaver">
		<bean class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver"/>
		</property>
	</bean>

	<bean id="loggingEntityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
		<property name="persistenceUnitName" value="loggingPU" />
		<property name="dataSource" ref="loggingDataSource" />
		<property name="jpaVendorAdapter">
			<bean class="org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter">
				<property name="databasePlatform" value="${ranger.jpa.jdbc.dialect}" />
				<property name="showSql" value="${ranger.jpa.showsql}" />
				<property name="generateDdl" value="false" />
			</bean>
		</property>
		<property name="jpaPropertyMap">
		<props>
			<prop key="eclipselink.weaving">false</prop>
		</props>
		 </property>
		<property name="loadTimeWeaver">
		<bean class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver"/>
		</property>
	</bean>

	<bean id="xmlPropertyConfigurer" class="org.apache.ranger.common.XMLPropertiesUtil" />

	<bean id="propertyConfigurer" class="org.apache.ranger.common.PropertiesUtil">
		<property name="locations">
			<list>
				<!-- <value>classpath:xa_default.properties</value> -->
				<!-- <value>classpath:xa_system.properties</value> -->
				<!-- <value>classpath:xa_custom.properties</value> -->
				<!-- <value>classpath:xa_ldap.properties</value> -->
				<value>classpath:core-site.xml</value>
				<value>classpath:ranger-admin-default-site.xml</value>
				<value>classpath:ranger-admin-site.xml</value>
			</list>
		</property>
		<property name="propertiesPersister" ref="xmlPropertyConfigurer" />
	</bean>

	<bean class="org.springframework.beans.factory.config.CustomScopeConfigurer">
		<property name="scopes">
			<map>
				<entry key="session">
					<bean class="org.springframework.web.context.request.SessionScope" />
				</entry>
				<entry key="request">
					<bean class="org.springframework.web.context.request.RequestScope" />
				</entry>
			</map>
		</property>
	</bean>

	<bean id="messageMappingConfigurer" class="org.apache.ranger.common.ErrorMessageUtil">
		<property name="locations">
			<list>
				<value>classpath:db_message_bundle.properties</value>
			</list>
		</property>
	</bean>

	<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
		<property name="entityManagerFactory" ref="defaultEntityManagerFactory" />
	</bean>

	<bean id="transactionManager2" class="org.springframework.orm.jpa.JpaTransactionManager">
		<property name="entityManagerFactory" ref="loggingEntityManagerFactory" />
	</bean>

	<bean id="dataSource" class="org.apache.ranger.common.jdbc.DynamicDataSource">
		<property name="targetDataSources">
			<map key-type="java.lang.String">
			</map>
		</property>
	</bean>

	<!-- Datasource and Connection Pool Configuration http://www.mchange.com/projects/c3p0/index.jsp#configuration_properties -->
	<bean id="defaultDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
		<property name="driverClass">
			<value>${ranger.jpa.jdbc.driver}</value>
		</property>
		<property name="jdbcUrl">
			<value>${ranger.jpa.jdbc.url}</value>
		</property>
		<property name="user">
			<value>${ranger.jpa.jdbc.user}</value>
		</property>
		<property name="password">
			<value>${ranger.jpa.jdbc.password}</value>
		</property>
		<property name="maxPoolSize">
			<!-- <value>20</value> -->
			<value>${ranger.jpa.jdbc.maxpoolsize}</value>
		</property>
		<property name="minPoolSize">
			<value>${ranger.jpa.jdbc.minpoolsize}</value>
		</property>
		<property name="initialPoolSize">
			<value>${ranger.jpa.jdbc.initialpoolsize}</value>
		</property>
		<!-- Seconds a Connection can remain pooled but unused before being discarded.
		Zero means idle connections never expire. -->
		<property name="maxIdleTime">
			<value>${ranger.jpa.jdbc.maxidletime}</value>
		</property>
		<property name="maxStatements">
			<value>${ranger.jpa.jdbc.maxstatements}</value>
		</property>
		<property name="preferredTestQuery">
			<value>${ranger.jpa.jdbc.preferredtestquery}</value>
		</property>
		<property name="idleConnectionTestPeriod">
			<value>${ranger.jpa.jdbc.idleconnectiontestperiod}</value>
		</property>
		<property name="acquireRetryAttempts">
			<value>${ranger.jpa.jdbc.acquireRetryAttempts}</value>
		</property>
	</bean>

	<bean id="loggingDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
		<property name="driverClass">
			<value>${ranger.jpa.jdbc.driver}</value>
		</property>
		<property name="jdbcUrl">
			<value>${ranger.jpa.audit.jdbc.url}</value>
		</property>
		<property name="user">
			<value>${ranger.jpa.jdbc.user}</value>
		</property>
		<property name="password">
			<value>${ranger.jpa.jdbc.password}</value>
		</property>
		<property name="maxPoolSize">
			<!-- <value>20</value> -->
			<value>${ranger.jpa.jdbc.maxpoolsize}</value>
		</property>
		<property name="minPoolSize">
			<value>${ranger.jpa.jdbc.minpoolsize}</value>
		</property>
		<property name="initialPoolSize">
			<value>${ranger.jpa.jdbc.initialpoolsize}</value>
		</property>
		<!-- Seconds a Connection can remain pooled but unused before being discarded.
		Zero means idle connections never expire. -->
		<property name="maxIdleTime">
			<value>${ranger.jpa.jdbc.maxidletime}</value>
		</property>
		<property name="maxStatements">
			<value>${ranger.jpa.jdbc.maxstatements}</value>
		</property>
		<property name="preferredTestQuery">
			<value>${ranger.jpa.jdbc.preferredtestquery}</value>
		</property>
		<property name="idleConnectionTestPeriod">
			<value>${ranger.jpa.jdbc.idleconnectiontestperiod}</value>
		</property>
	</bean>

	<bean id="velocityEngine"
	class="org.springframework.ui.velocity.VelocityEngineFactoryBean">
		<property name="velocityProperties">
			<value>resource.loader=class
				class.resource.loader.class=org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader</value>
		</property>
	</bean>
	<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
		<property name="basenames">
			<list>
				<value>WEB-INF/classes/internationalization/messages</value>
			</list>
		</property>
	</bean>
	<bean id="restTemplate" class="org.springframework.web.client.RestTemplate"></bean>
</beans>

對應MATA-INF目錄文件persistence.xml

<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
	<persistence-unit name="defaultPU">
		<mapping-file>META-INF/jpa_named_queries.xml</mapping-file>

		<class>org.apache.ranger.entity.XXDBBase</class>
		<class>org.apache.ranger.entity.XXAuthSession</class>
		<class>org.apache.ranger.entity.XXPortalUser</class>
		<class>org.apache.ranger.entity.XXPortalUserRole</class>
		<class>org.apache.ranger.entity.XXAsset</class>
		<class>org.apache.ranger.entity.XXResource</class>
		<class>org.apache.ranger.entity.XXCredentialStore</class>
		<class>org.apache.ranger.entity.XXGroup</class>
		<class>org.apache.ranger.entity.XXUser</class>
		<class>org.apache.ranger.entity.XXGroupUser</class>
		<class>org.apache.ranger.entity.XXGroupGroup</class>
		<class>org.apache.ranger.entity.XXPermMap</class>
		<class>org.apache.ranger.entity.XXAuditMap</class>
		<class>org.apache.ranger.entity.XXPolicyExportAudit</class>
		<class>org.apache.ranger.entity.XXTrxLog</class>
		<!--0.5 -->
		<class>org.apache.ranger.entity.XXServiceDefBase</class>
		<class>org.apache.ranger.entity.XXServiceDefWithAssignedId</class>
		<class>org.apache.ranger.entity.XXServiceDef</class>
		<class>org.apache.ranger.entity.XXServiceBase</class>
		<class>org.apache.ranger.entity.XXServiceWithAssignedId</class>
		<class>org.apache.ranger.entity.XXService</class>
		<class>org.apache.ranger.entity.XXPolicyBase</class>
		<class>org.apache.ranger.entity.XXPolicyWithAssignedId</class>
		<class>org.apache.ranger.entity.XXPolicy</class>
		<class>org.apache.ranger.entity.XXServiceConfigDef</class>
		<class>org.apache.ranger.entity.XXResourceDef</class>
		<class>org.apache.ranger.entity.XXAccessTypeDef</class>
		<class>org.apache.ranger.entity.XXAccessTypeDefGrants</class>
		<class>org.apache.ranger.entity.XXPolicyConditionDef</class>
		<class>org.apache.ranger.entity.XXContextEnricherDef</class>
		<class>org.apache.ranger.entity.XXEnumDef</class>
		<class>org.apache.ranger.entity.XXEnumElementDef</class>
		<class>org.apache.ranger.entity.XXServiceConfigMap</class>
		<class>org.apache.ranger.entity.XXPolicyResource</class>
		<class>org.apache.ranger.entity.XXPolicyResourceMap</class>
		<class>org.apache.ranger.entity.XXPolicyItem</class>
		<class>org.apache.ranger.entity.XXPolicyItemAccess</class>
		<class>org.apache.ranger.entity.XXPolicyItemCondition</class>
		<class>org.apache.ranger.entity.XXPolicyItemGroupPerm</class>
		<class>org.apache.ranger.entity.XXPolicyItemUserPerm</class>
		<class>org.apache.ranger.entity.XXDataHist</class>
		<class>org.apache.ranger.entity.XXModuleDef</class>
		<class>org.apache.ranger.entity.XXGroupPermission</class>
		<class>org.apache.ranger.entity.XXUserPermission</class>
		<!--0.6 -->
		<class>org.apache.ranger.entity.XXTagDef</class>
		<class>org.apache.ranger.entity.XXTag</class>
		<class>org.apache.ranger.entity.XXServiceResource</class>
		<class>org.apache.ranger.entity.XXServiceResourceElement</class>
		<class>org.apache.ranger.entity.XXTagAttributeDef</class>
		<class>org.apache.ranger.entity.XXTagAttribute</class>
		<class>org.apache.ranger.entity.XXTagResourceMap</class>
		<class>org.apache.ranger.entity.XXServiceResourceElementValue</class>
		<class>org.apache.ranger.entity.XXDataMaskTypeDef</class>
		<class>org.apache.ranger.entity.XXPolicyItemDataMaskInfo</class>
		<class>org.apache.ranger.entity.XXPolicyItemRowFilterInfo</class>
		<class>org.apache.ranger.entity.XXServiceVersionInfo</class>
		<class>org.apache.ranger.entity.XXPluginInfo</class>

		<class>org.apache.ranger.entity.XXDataMaskFunction</class>
		<class>org.apache.ranger.entity.XXDataMaskFunctionBase</class>
		<class>org.apache.ranger.entity.XXDataMaskFunctionParams</class>
		<class>org.apache.ranger.entity.XXDataMaskRule</class>
		<class>org.apache.ranger.entity.XXDataMaskRuleBase</class>
		<class>org.apache.ranger.entity.XXDataMaskRuleParams</class>
		<class>org.apache.ranger.entity.XXDataMaskConfigs</class>

        <shared-cache-mode>NONE</shared-cache-mode>

		<properties>
			<property name="eclipselink.logging.level" value="WARNING"/>
		</properties>
	</persistence-unit>
	<persistence-unit name="loggingPU">
		<mapping-file>META-INF/jpa_named_queries.xml</mapping-file>
        <class>org.apache.ranger.entity.XXAccessAudit</class>
        <shared-cache-mode>NONE</shared-cache-mode>

		<properties>
			<property name="eclipselink.logging.level" value="WARNING"/>
		</properties>
	</persistence-unit>

</persistence>

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章