亚洲综合社区欧美综合色-欧美逼逼一区二区三区-国产老熟女高潮精品网站-国产日韩最新视频在线看

始創(chuàng)于2000年 股票代碼:831685
咨詢熱線:0371-60135900 注冊有禮 登錄
  • 掛牌上市企業(yè)
  • 60秒人工響應
  • 99.99%連通率
  • 7*24h人工
  • 故障100倍補償
全部產(chǎn)品
您的位置: 網(wǎng)站首頁 > 幫助中心>文章內(nèi)容

Spring Security ACL使用Oracle數(shù)據(jù)庫的配置與數(shù)據(jù)庫腳本

發(fā)布時間:  2012/9/16 14:30:29

在Spring Security的官方文檔上面只給出了關于security ACL的hsql腳本,但是在使用Oracle數(shù)據(jù)庫時spring沒有明確給出數(shù)據(jù)庫創(chuàng)建腳本和配置說明,以下是自己在使用Oracle數(shù)據(jù)庫時使用到的sql腳本和配置

sql腳本如下

--------------------------------------------------------   
-- Create sequences   
--------------------------------------------------------   
CREATE SEQUENCE "ACL_CLASS_SEQ"  
  INCREMENT BY 1  
  MAXVALUE 9999999999999999999999999999  
  START WITH 1  
  CACHE 20  
  NOORDER   
  NOCYCLE;   
    
CREATE SEQUENCE "ACL_ENTRY_SEQ"  
  INCREMENT BY 1  
  MAXVALUE 9999999999999999999999999999  
  START WITH 1  
  CACHE 20  
  NOORDER   
  NOCYCLE;   
    
CREATE SEQUENCE "ACL_OBJECT_IDENTITY_SEQ"  
  INCREMENT BY 1  
  MAXVALUE 9999999999999999999999999999  
  START WITH 1  
  CACHE 20  
  NOORDER   
  NOCYCLE;   
    
CREATE SEQUENCE "ACL_SID_SEQ"  
  INCREMENT BY 1  
  MAXVALUE 9999999999999999999999999999  
  START WITH 1  
  CACHE 20  
  NOORDER   
  NOCYCLE;   
    
--------------------------------------------------------   
-- ACL_CLASS Table   
--------------------------------------------------------   
CREATE TABLE "ACL_CLASS" (   
  "ID" NUMBER(19,0) NOT NULL,   
  "CLASS" VARCHAR2(100) NOT NULL,   
  PRIMARY KEY ("ID"),   
  CONSTRAINT "ACL_CLASS_CLASS_UQ" UNIQUE ("CLASS")   
)TABLESPACE &TSDATA;   
    
--------------------------------------------------------   
-- ACL_ENTRY Table   
--------------------------------------------------------   
CREATE TABLE "ACL_ENTRY" (   
  "ID" NUMBER(19,0) NOT NULL,   
  "ACL_OBJECT_IDENTITY" NUMBER(19,0) NOT NULL,   
  "ACE_ORDER" NUMBER(19,0) NOT NULL,   
  "SID" NUMBER(19,0) NOT NULL,   
  "MASK" NUMBER(19,0) NOT NULL,   
  "GRANTING" NUMBER(1,0) NOT NULL,   
  "AUDIT_SUCCESS" NUMBER(1,0) NOT NULL,   
  "AUDIT_FAILURE" NUMBER(1,0) NOT NULL,   
  PRIMARY KEY ("ID"),   
  CONSTRAINT "ACL_ENTRY_IDENT_ORDER_UQ" UNIQUE ("ACL_OBJECT_IDENTITY", "ACE_ORDER")   
)TABLESPACE &TSDATA;   
    
ALTER TABLE "ACL_ENTRY" ADD CONSTRAINT "ACL_ENTRY_GRANTING_CK"  
  CHECK ("GRANTING" in (1,0));   
ALTER TABLE "ACL_ENTRY" ADD CONSTRAINT "ACL_ENTRY_AUDIT_SUCCESS_CK"  
  CHECK ("AUDIT_SUCCESS" in (1,0));   
ALTER TABLE "ACL_ENTRY" ADD CONSTRAINT "ACL_ENTRY_AUDIT_FAILURE_CK"  
  CHECK ("AUDIT_FAILURE" in (1,0));   
    
--------------------------------------------------------   
-- ACL_OBJECT_IDENTITY Table   
--------------------------------------------------------   
CREATE TABLE "ACL_OBJECT_IDENTITY" (   
  "ID" NUMBER(19,0) NOT NULL,   
  "OBJECT_ID_CLASS" NUMBER(19,0) NOT NULL,   
  "OBJECT_ID_IDENTITY" NUMBER(19,0) NOT NULL,   
  "PARENT_OBJECT" NUMBER(19,0),   
  "OWNER_SID" NUMBER(19,0) NOT NULL,   
  "ENTRIES_INHERITING" NUMBER(1,0) NOT NULL,   
  PRIMARY KEY ("ID"),   
  CONSTRAINT "ACL_OBJ_ID_CLASS_IDENT_UQ" UNIQUE ("OBJECT_ID_CLASS", "OBJECT_ID_IDENTITY")   
)TABLESPACE &TSDATA;   
    
ALTER TABLE "ACL_OBJECT_IDENTITY" ADD CONSTRAINT "ACL_OBJ_ID_ENTRIES_CK"  
  CHECK ("ENTRIES_INHERITING" in (1,0));   
    
--------------------------------------------------------   
-- ACL_SID Table   
--------------------------------------------------------   
CREATE TABLE "ACL_SID" (   
  "ID" NUMBER(19,0) NOT NULL,   
  "PRINCIPAL" NUMBER(1,0) NOT NULL,   
  "SID" VARCHAR2(100) NOT NULL,   
  PRIMARY KEY ("ID"),   
  CONSTRAINT "ACL_SID_PRINCIPAL_SID_UQ" UNIQUE ("SID", "PRINCIPAL")   
)TABLESPACE &TSDATA;   
    
ALTER TABLE "ACL_SID" ADD CONSTRAINT "ACL_SID_PRINCIPAL_CK"  
  CHECK ("PRINCIPAL" in (1,0));   
    
--------------------------------------------------------   
-- Relationships   
--------------------------------------------------------   
    
ALTER TABLE "ACL_ENTRY" ADD CONSTRAINT "FK_ACL_ENTRY_ACL_OBJECT_ID"  
  FOREIGN KEY ("ACL_OBJECT_IDENTITY")   
  REFERENCES "ACL_OBJECT_IDENTITY" ("ID");   
ALTER TABLE "ACL_ENTRY" ADD CONSTRAINT "FK_ACL_ENTRY_SID"  
  FOREIGN KEY ("SID")   
  REFERENCES "ACL_SID" ("ID");   
    
ALTER TABLE "ACL_OBJECT_IDENTITY" ADD CONSTRAINT "FK_ACL_OBJ_ID_CLASS"  
  FOREIGN KEY ("OBJECT_ID_CLASS")   
  REFERENCES "ACL_CLASS" ("ID");   
ALTER TABLE "ACL_OBJECT_IDENTITY" ADD CONSTRAINT "FK_ACL_OBJ_ID_PARENT"  
  FOREIGN KEY ("PARENT_OBJECT")   
  REFERENCES "ACL_OBJECT_IDENTITY" ("ID");   
ALTER TABLE "ACL_OBJECT_IDENTITY" ADD CONSTRAINT "FK_ACL_OBJ_ID_SID"  
  FOREIGN KEY ("OWNER_SID")   
  REFERENCES "ACL_SID" ("ID");   
    
--------------------------------------------------------   
-- Triggers   
--------------------------------------------------------   
CREATE OR REPLACE TRIGGER "ACL_CLASS_ID"  
BEFORE INSERT ON ACL_CLASS   
FOR EACH ROW   
  BEGIN   
    SELECT ACL_CLASS_SEQ.NEXTVAL INTO :new.id FROM dual;   
  END;   
/   
    
CREATE OR REPLACE TRIGGER "ACL_ENTRY_ID"  
BEFORE INSERT ON ACL_ENTRY   
FOR EACH ROW   
  BEGIN   
    SELECT ACL_ENTRY_SEQ.NEXTVAL INTO :new.id FROM dual;   
  END;   
/   
    
CREATE OR REPLACE TRIGGER "ACL_OBJECT_IDENTITY_ID"  
BEFORE INSERT ON ACL_OBJECT_IDENTITY   
FOR EACH ROW   
  BEGIN   
    SELECT ACL_OBJECT_IDENTITY_SEQ.NEXTVAL INTO :new.id FROM dual;   
  END;   
/   
    
CREATE OR REPLACE TRIGGER "ACL_SID_ID"  
BEFORE INSERT ON ACL_SID   
FOR EACH ROW   
  BEGIN   
    SELECT ACL_SID_SEQ.NEXTVAL INTO :new.id FROM dual;   
  END;   
/  

spring配置片段如下

<beans:bean id="aclService" class="org.springframework.security.acls.jdbc.JdbcMutableAclService">  
    <beans:constructor-arg ref="dataSource" />  
    <beans:constructor-arg ref="lookupStrategy" />  
    <beans:constructor-arg ref="aclCache" />  
       
    <beans:property name="classIdentityQuery" value="select ACL_CLASS_SEQ.currval from dual"/>  
    <beans:property name="sidIdentityQuery" value="select ACL_SID_SEQ.currval from dual"/>  
</beans:bean> 


本文出自:億恩科技【1tcdy.com】

服務器租用/服務器托管中國五強!虛擬主機域名注冊頂級提供商!15年品質(zhì)保障!--億恩科技[ENKJ.COM]

  • 您可能在找
  • 億恩北京公司:
  • 經(jīng)營性ICP/ISP證:京B2-20150015
  • 億恩鄭州公司:
  • 經(jīng)營性ICP/ISP/IDC證:豫B1.B2-20060070
  • 億恩南昌公司:
  • 經(jīng)營性ICP/ISP證:贛B2-20080012
  • 服務器/云主機 24小時售后服務電話:0371-60135900
  • 虛擬主機/智能建站 24小時售后服務電話:0371-60135900
  • 專注服務器托管17年
    掃掃關注-微信公眾號
    0371-60135900
    Copyright© 1999-2019 ENKJ All Rights Reserved 億恩科技 版權所有  地址:鄭州市高新區(qū)翠竹街1號總部企業(yè)基地億恩大廈  法律顧問:河南亞太人律師事務所郝建鋒、杜慧月律師   京公網(wǎng)安備41019702002023號
      1
     
     
     
     

    0371-60135900
    7*24小時客服服務熱線