Crodys using Oracle synonym Solutions

Source: Internet
Author: User
Tags svn

Take a list of process business information to illustrate the use of Oracle synonym solutions.
The following objects are available in the Oracle database Bpm_sun User:

Object Name type Description
Sun_biz_base Table
Sub_focusprocess Table
Sub_biz_info Synonym Create synonym sun_biz_info for bpm_manager.biz_info;

The query list SQL statement looks like this:

select a.title,to_char(a.live_date,‘yyyy-mm-dd‘),b.endflow from sun_biz_info a,sun_biz_base b where a.info_id = b.info_id and a.rvsn_number=b.rvsn_number;

The query results are as follows:

Synonyms Using Solutions

In the data source (database Matedata), Oracle Databases objects are only: Tables, views, procedures three, no synonym synonyms option.

How can I use synonyms (synonyms)?
When creating WebService, select the tables in one or more of the databases that are visible, and select the Sun_biz_base and sun_focusprocess two tables as shown in the example.
Create a new custom WebService with the name: Querybizlist

With the Ws-appserver package tool, the following Java code is generated, and then the code for the synonym SQL statement is written by synchronizing the code to SVN, based on the Eclipse development tool.

/ * This class had been generated by the Code generator*/ PackageCom.unicom.sun.sunpackage;ImportCom.cordys.cpc.bsf.busobject.BusObjectConfig;ImportCom.cordys.cpc.bsf.busobject.QueryObject; Public  class sun_biz_base extends sun_biz_basebase{     Public Sun_biz_base()    { This((Busobjectconfig)NULL); } Public Sun_biz_base(busobjectconfig config) {Super(config); } Public StaticStringquerybizlist() {String sql="Select A.title,to_char (a.live_date, ' yyyy-mm-dd '), B.endflow"; SQL + ="from Sun_biz_info a,sun_biz_base B"; SQL + ="Where a.info_id = b.info_id and A.rvsn_number=b.rvsn_number"; Queryobject query =NewQueryobject (SQL);//TODO Implement body        returnQuery.getobject (). toString (); }}

Note: the "table" Sun_biz_info is synonymous with the above SQL statement.


By using SVN to bring the Java code back to the Cordys platform, compile the code and publish and publish the WebService, the test tool is operation with the WebService test tools and the results are as follows:

Conclusion

This verification enables the use of the Oracle synonym Technology Scheme on the Cordys platform, with the following conclusions:

    • 1. Private synonyms do not differ from public synonyms;
    • Services for synonyms are not provided in 2.Database Metadata, and synonyms are not recognized as tables. That is, you cannot create a method directly for a synonym through database Metadata;
    • 3. Using synonyms is the first way to create a method from another table (Tables), and then modify the method's SQL statement to operate on the synonym instead.

Due to the limited author level, feedback discussion is welcome.

Related documents: Oracle Synonyms Concise usage Sho Yongwei 2015.5

Crodys using Oracle synonym Solutions

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.