psr_base_tables.lwm 2.71 KB
Newer Older
Spencer Chang's avatar
Spencer Chang committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: wby  
    $Date: 2013-1-22 下午2:35:12  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="PSR_BASE_TABLES" defaultOrderBy="table_name">
    <bm:operations>
        <bm:operation name="delete">
            <bm:update-sql><![CDATA[
			
			begin
				PSR_REPORT_PKG.delete_base_table(
					p_table_name => ${@table_name},
					p_user_id	 => ${/session/@user_id}
				);
			end;
			
			]]></bm:update-sql>
            <bm:parameters>
                <bm:parameter name="table_name"/>
            </bm:parameters>
        </bm:operation>
        <bm:operation name="insert">
            <bm:update-sql><![CDATA[
	    	 begin
		    	 	insert into 
		    	 	psr_base_tables(
		    	 		table_name,
		    	 		table_description,
		    	 		table_alias,
		    	 		default_table_flag,
		    	 		created_by,
		    	 		creation_date,
		    	 		last_updated_by,
		    	 		last_update_date,
		    	 		user_id
		    	 	)
		    	 	values(
		    	 		UPPER(${@table_name}),
		    	 		${@table_description},
		    	 		${@table_alias},
		    	 		${@default_table_flag},
		    	 		${/session/@user_id},
		    	 		sysdate,
		    	 		${/session/@user_id},
		    	 		sysdate,
		    	 		${/session/@user_id}
		    	 	);
	    	 	end;
    	 	
    	 ]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="table_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TABLE_NAME" prompt="PSR_BASE_TABLES.TABLE_NAME"/>
        <bm:field name="table_description" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TABLE_DESCRIPTION" prompt="PSR_BASE_TABLES.TABLE_DESCRIPTION"/>
        <bm:field name="table_alias" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TABLE_ALIAS" prompt="PSR_BASE_TABLES.TABLE_ALIAS"/>
        <bm:field name="default_table_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DEFAULT_TABLE_FLAG" prompt="PSR_BASE_TABLES.DEFAULT_TABLE_FLAG"/>
        <bm:field name="user_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="USER_ID" prompt="PSR_BASE_TABLES.USER_ID"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="table_name"/>
    </bm:primary-key>
    <!-- <bm:data-filters>
        <bm:data-filter name="query" enforceOperations="query" expression="t1.user_id = ${/session/@user_id}"/>
    </bm:data-filters> -->
    <bm:query-fields>
        <bm:query-field name="table_name" queryExpression="t1.table_name like &apos;%&apos; || ${@table_name} || &apos;%&apos;"/>
    </bm:query-fields>
</bm:model>