Generate database schema

I've two classes
public class Aggregation
// Each element is an instance of Individual
private List elementList = new ArrayList();
...getter/setter...
public class Individual
private String name = null;
...getter/setter...
If I want to generate only two database tables using SchemaTool,
t_aggregation and t_individual, without additional field in class
Individual. How to write metadata file? How can I associate t_aggregation
with t_individual?
Can kodo automatically generate :
create table t_individual
name VARCHAR(255),
aggregationIdx BIGINT(20),
Thanks
Liang Zhilong
EMail : [email protected]
Tel : (021)54235858-6650
Fax : (021)54235800
PhotonicBridges Co., Ltd.
12F, 900 Yi Shan Rd., Shanghai 200233

Liang-
If you can add an field in Individual valled "aggregation" that refers
back to the Aggregation that owns it, then you can use the inverse
extension. E.g., something like:
<class name="Aggregation">
<field name="elementList">
<collection element-type="Individual"/>
<extension vendor-name="kodo" key="inverse" value="aggregation"/>
</field>
</class>
<class name="Individual">
<field name="aggregation"/>
</class>
You will need the back-reference "aggregation" field, though: this is a
restriction that we hope to eliminate in the future.
See:
http://docs.solarmetric.com/manual.html#meta-field-inverse
In article <bdu17e$drj$[email protected]>, Liang Zhilong wrote:
I've two classes
public class Aggregation
// Each element is an instance of Individual
private List elementList = new ArrayList();
...getter/setter...
public class Individual
private String name = null;
...getter/setter...
If I want to generate only two database tables using SchemaTool,
t_aggregation and t_individual, without additional field in class
Individual. How to write metadata file? How can I associate t_aggregation
with t_individual?
Can kodo automatically generate :
create table t_individual
name VARCHAR(255),
aggregationIdx BIGINT(20),
Thanks
Liang Zhilong
EMail : [email protected]
Tel : (021)54235858-6650
Fax : (021)54235800
PhotonicBridges Co., Ltd.
12F, 900 Yi Shan Rd., Shanghai 200233
Marc Prud'hommeaux [email protected]
SolarMetric Inc. http://www.solarmetric.com

Similar Messages

  • How to generate database schema from CMP?

    I'm using JDeveloper 10g to design J2EE application in the Up-bottom manner. Then I have written UML model with CMP beans and now I would like deploy the model to the database. Is there a wizard to automaticly generate database schema from CMP beans?
    Marek

    Here are some links that might help you:
    The Oracle XML Developer's Kits (XDK) contain the basic building blocks for reading, manipulating, transforming and viewing XML documents. Includes XML Schema Processor: supporting Java, C, and C++, allows use of XML simple and complex datatypes.
    http://otn.oracle.com/tech/xml/xdkhome.html
    Building Server-Side XML Schema Validation
    Discusses how XML Schema can be used within Oracle9i to validate XML documents.
    http://otn.oracle.com/tech/xml/xdk_sample/xdksample_093001.html
    How XML Schemas Simplify Dynamic Content Management
    With XML Schema now a W3C Recommendation, compare Document Type Definitions to XML Schema.
    http://otn.oracle.com/tech/xml/htdocs/SchemDTD.html
    Regards,
    -rh

  • Generate database schema in XML from database structure

    hi
    I want to generate the entire database schema in XML from database structure. (Same feature is provided by Altova XMLSpy).
    It would be great if there was some API that does the process of parsing the database structure and generating the XML automatically. A similiar feature is provided by Apache DdlUtils' API, but a stable version is not yet available...
    Please help!
    Thanks in advance.

    Nikhil,
    There is a wealth of information available on the Internet regarding the XML capabilities of the Oracle database.
    Have you done an Internet search for "SQL XML Oracle"?
    Good Luck,
    Avi.

  • Why generate object-oriented database schema

    Let me begin with an example:
    public class Base
    protected int id = 0;
    protected String name = null;
    public class Derived extends Base
    protected int type = 0;
    Derived class and Base class form an object-oriented inheritence. After
    using SchemaToolTask, the following table definition is generated :
    create table base
    id INT NOT NULL,
    name VARCHAR(255),
    PRIMARY KEY (id)
    create table derived
    id INT NOT NULL,
    type INT,
    PRIMARY KEY (id)
    Actually, RDBMS is ER-oriented. Every meaningful entity corresponds to a
    database table. But in this example, maybe "Base" has no any meaning, just
    for abstraction. So why we must generate this table ? Why cannot be
    configurated to just generate
    create table derived
    id INT NOT NULL,
    name VARCHAR(255),
    type INT,
    PRIMARY KEY (id)
    This will not only avoid join operation in SELECT, but also reduce the table
    size according to Base class.
    Thanks
    Liang Zhilong
    EMail : [email protected]
    Tel : (021)54235858-6650
    Fax : (021)54235800
    PhotonicBridges Co., Ltd.
    12F, 900 Yi Shan Rd., Shanghai 200233

    As I said, this is quite high on our project plans.
    On Wed, 25 Jun 2003 14:41:29 +0800, Liang Zhilong wrote:
    I believe your concern is reasonable. However, in our application, the
    operation you assumed( to find all base instances owned by class C) is
    rare, so it'll be useful if my suggested mapping is taken as an option.
    Moreover, we should not get better performance at the cost of worse
    database schema. Kodo should have enough capacity to optimize database
    operations. For example, to find all base instances owned by class C, kodo
    should issue a "SELECT col1, col2 FROM a UNION SELECT col1, col2 FROM b".
    "Stephen kim" <[email protected]>
    ??????:[email protected]...
    This sort of mapping is on our project plan but know that there a number
    of severe performance penalties that can happen with the mapping you
    describe. If you desire to lack the join, a flat-class mapping is the
    most efficient table structure.
    Take for example the multiple classes problem:
    base
    |_ A
    |_ B
    which would result in table a and table b. Now try to do an ordering
    query. You would issue 2 selects and then have to merge in memory. To
    do any relation join, again you multiply the number of SQL statements by
    the number of subclasses (e.g. to find all base instances owned by class
    C, you would have to query against a and b).
    On Wed, 25 Jun 2003 12:39:39 +0800, Liang Zhilong wrote:
    Let me begin with an example:
    public class Base
    protected int id = 0;
    protected String name = null;
    public class Derived extends Base
    protected int type = 0;
    Derived class and Base class form an object-oriented inheritence.
    After using SchemaToolTask, the following table definition is
    generated :
    create
    table base
    id INT NOT NULL,
    name VARCHAR(255),
    PRIMARY KEY (id)
    create table derived
    id INT NOT NULL,
    type INT,
    PRIMARY KEY (id)
    Actually, RDBMS is ER-oriented. Every meaningful entity corresponds to
    a database table. But in this example, maybe "Base" has no any
    meaning,just
    for abstraction. So why we must generate this table ? Why cannot be
    configurated to just generate
    create table derived
    id INT NOT NULL,
    name VARCHAR(255),
    type INT,
    PRIMARY KEY (id)
    This will not only avoid join operation in SELECT, but also reduce the
    table size according to Base class.
    Thanks
    Liang Zhilong
    EMail : [email protected]
    Tel : (021)54235858-6650
    Fax : (021)54235800
    PhotonicBridges Co., Ltd.
    12F, 900 Yi Shan Rd., Shanghai 200233--
    Steve Kim
    [email protected]
    SolarMetric Inc.
    http://www.solarmetric.com
    Steve Kim
    [email protected]
    SolarMetric Inc.
    http://www.solarmetric.com

  • Generate XML Schema from Oracle Database

    Is there a utility that would allow our team to generate XML Schemas directly from existing Oracle databases? Or do you have a suggestion on how to achieve this?
    Thank you.

    Hey, The Schema Processor is available in the Technologies section on this site. Just download it and see the samples. You will get the way for doing it. If you are having problems then just call me.
    Bye.
    null

  • Generating database in the user schema other than the login user

    I have to generate database into ESP schema.
    But in my office the schema specific users don't have create privileges(ex: ESP user for ESP schema).
    Cause, we usually have to work on more than one project at a time, so our DBA gives all the privileges to my own id(ex: navya) and only select privilege to schema specific users. So, when i have to generate a database, if i give ESP login details, i get error of insufficient privilege. And if i give my personal login the database is getting generated in my schema. All i am doing right now is generating ddl files and in those files adding schema name in front of the objects.
    But, is there any better way to do it.
    Thanks.
    Navya.

    Hai!
    I belive it is not a license issue.
    Please tell me the following things-
    How can I mapped the period on the numbering series window ?
    >> Their is a field in Numering window as Period Indiator (if, not enable using form settings)
    this should be same as Period Indicator in Posting Period window of selected period
    How can I set the default periodset for all users. where is the option to set it for all users?
    >> First, click the Drop down box of Posting Period in Numbering Window
    select the current period. Numbering window display only the Numbering series linked with current Period.
    select any one Numbering series on those by cliking on it's row no.
    Click to Set as Default Button in right coner of Numbering window.
    Select second option For All Users
    Now, try to open the Document for which you have done this settings.
    Regards,
    Thanga Raj.K
    +91 9710445987

  • Database schema SCM does not contain the associated database objects

    I am getting the following error when i am trying to migrate the form to apex using application migration.
    "*Database schema SCM does not contain the associated database objects for the project, aafs.*
    *Ensure the database schema associated with the project contains the database objects associated with the uploaded Forms Module .XML file(s).* ".
    Actully i am having one schema which i named as SCM, and i have defined one table TT.
    I created one form test.fmb in which i used TT table.its compiled successfully.
    Then i generated the xml file using frmf2xml from fmb file. After that, I created the project in appication migration wizard in SCM schema.
    Project creattion is working fine.but when i m trying to create application,it is showing me above error.
    can any one help in solving this problem.

    Hi Hilary,
    Thanks for your response/feedback.
    1. The schema associated with the project does not contain the necessary objects Can you please verify that the schema associated with your Forms conversion project does in fact contain the objects associated with the uploaded files. Could you also verify that the object names referenced in the error message do not exist within the schema associated with your workspace. Ensure that the schema associated with the project contains the necessary database objects before proceeding to the generation phase of the conversion process.
    Ans:
    Yes it does contain the objects (See results from SQL query Commands below):
    SELECT MWRA_CONTRACT_NO, OLD_CONTRACT_NO FROM PROJECTS@CONTRACT_LX19.MWRA.NET
    ORDER BY MWRA_CONTRACT_NO
    000000569 551TA
    000000570 553TA
    000000575 560TA
    000000576 561TA
    000107888 502TA
    000108498 500TA
    000108502 503TA
    2. The block being converted contains buttons, which may have been incorrectly identified as database columns, and included in the original or enhanced query associated with your block This is a known issue ,bug 9827853, and a fix will be available in our upcoming 4.0.1 patch release. Some possible solutions to this issue are:
    -> delete the buttons before generating the XML
    -> delete the button tags from the XML
    -> add "DatabaseItem=No" for the button in the XML file before importing it in Apex.The button is excluded when creating the Application.
    Ans
    yes it does contain push buttons to transfer to another forms and these are defined as Non data base items. Parial XML code provided below:
    - <Item Name="REPORTS" FontSize="900" DirtyInfo="true" Height="188" XPosition="4409" FontName="Fixedsys" ForegroundColor="black" DatabaseItem="false" Width="948" CompressionQuality="None" YPosition="3709" FontSpacing="Normal" Label="REPORTS" BackColor="canvas" FillPattern="transparent" ShowHorizontalScrollbar="false" FontWeight="Medium" ShowVerticalScrollbar="false" FontStyle="Plain" ItemType="Push Button">
    <Trigger Name="WHEN-BUTTON-PRESSED" TriggerText="GO_BLOCK('REPORT_1');" />
    </Item>
    - <Item Name="TRACKHDR" FontSize="900" DirtyInfo="true" Height="188" XPosition="3409" FontName="Fixedsys" ForegroundColor="black" DatabaseItem="false" Width="948" CompressionQuality="None" YPosition="3709" FontSpacing="Normal" Label="TRACK" BackColor="canvas" FillPattern="transparent" ShowHorizontalScrollbar="false" FontWeight="Medium" ShowVerticalScrollbar="false" FontStyle="Plain" ItemType="Push Button">
    <Trigger Name="WHEN-BUTTON-PRESSED" TriggerText="GO_BLOCK('TRACKHDRS');" />
    </Item>
    - <Item Name="SUBAWRD" FontSize="900" DirtyInfo="true" Height="188" XPosition="2429" FontName="Fixedsys" ForegroundColor="black" DatabaseItem="false" Width="948" CompressionQuality="None" YPosition="3719" FontSpacing="Normal" Label="SUBAWARDS" BackColor="canvas" FillPattern="transparent" ShowHorizontalScrollbar="false" FontWeight="Medium" ShowVerticalScrollbar="false" FontStyle="Plain" ItemType="Push Button">
    3. If you are still experiencing issues, then please create a testcase on apex.oracle.com and update this thread with the workspace details so I can take a look.
    Test case details are given below. It was created per ORACLE for open Service Request Number 3-1938902931 on ORACLE Metalink.
    Workspace: contract4
    username: [email protected] (my email)
    Password: contract4
    Comments:
    For my migration/testing purpose a dabatase link and synonyms have been setup by our ORACLE DBA. Could this be causing this problem?
    Do we know when the fix 4.0.1 patch release will be available?
    Thanks for your help.
    Indra

  • What is the best way to create a database schema from XML

    What is the best way to create a database schema from XML?
    i have  a complex XML file that I want to create a database from and consistently import new XML files of the same schema type. Currently I have started off by mapping the XSD into Excel and using Mysql for Excel to push into MySQL.
    There must be a more .net microsoft solution for this but I cannot locate the topic and tools by searching. What are the best tools and way to manage this?
    Taking my C# further

    Hi Saythj,
    When mentioning "a database schema from XML", do you mean the
    XML Schema Collections? If that is what you mean, when trying to import XML files of the same schema type, you may take the below approach.
    Create an XML Schema Collection basing on your complex XML, you can find
    many generating tools online to do that.
    Create a Table with the above created schema typed XML column as below.
    CREATE TABLE youTable( Col1 int, Col2 xml (yourXMLSchemaCollection))
    Load your XML files and try to insert the xml content into the table above from C# or some other approaches. The XMLs that can't pass the validation fail inserting into that table.
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • Generating database tables from Java classes

    Hi,
    I've encountered a number of tools which will create Java classes from database tables (e.g. JDeveloper has this functionality, Abator provides this for iBATIS, etc...).
    However, I've not been able to locate any tools that perform the opposite job - i.e. given a Java class, it generates a database table (or, presumably, some SQL).
    It's been suggested to me that Hibernate might provide this sort of capability, but if anybody has any experience of doing this, in any tool, I'd be interested to hear about it.
    Thanks,
    Alistair.

    Many thanks for the pointers.
    duffymo: I've taken a look at Middlegen (http://boss.bekk.no/boss/middlegen/index.html) but it seems that the first step is to specify the database schema, whereas I'm looking to generate the schema from existing code. Or have I missed something?
    Alistair.

  • Process flows objects in a database schema

    Hi,
    I want to find in a database schema the objects created by the Oracle Workflow. Is it possible?
    For example, when I create and deploy a mapping in OWB, a package is created in the target schema. I can handle it using only SQL.
    When I create a package, module and process flow in OWB, is it possible to visualize it in a database schema (for example, owf_mgr)?
    Thanks.

    Hi
    When you deploy a process flow it is transformed into an Oracle Workflow and stored in the workflow schema. There is a design client (Workflow Manager) and monitor tool (Workflow Monitor) for designing/editing workflows and monitoring them at runtime also there are views for viewing the created workflows.
    What do you want to do with the deployed workflow? Do you just want some SQL views to see the deployed object or do you want to execute the object 'natively' (like executing the MAIN of the generated PLSQL package?).
    Cheers
    David

  • AN ERROR OCCURRED WHILE OBTAINING DATABASE SCHEMAS sqlserver stored proc

    I have used the documented Oracle procedures for building the necessary wsdl and xsd files for a sql server 2000 and 2005 stored proc. The wsdl files and xsd are generated and incorporated per the tech doc. The process was working for a while and now, when we try to access the dbadapter partner link created using the wsd, we get the following error:
    "AN ERROR OCCURRED WHILE OBTAINING DATABASE SCHEMAS. VERIFY THAT THE DATABASE CONNECTION IS VALID AND IS SUPPORTED."
    We have tried getting this corrected by using each of the specified jar libraries as part of the project:
    sqljdbc.jar
    msutil.jar
    msbase.jar
    mssqlserver.jar
    Still, no solution.
    Anybody have this happen? Fixes? Help......

    If you used a command-line utility to generate your WSDL and XSD that would indicate that your JDev version does not support SQL Server so you can't use the Adapter Configuration Wizard to create partner links that execute stored procedures on SQL Server. Creating the initial partner link using the generated WSDL and XSD file will work fine, but if you try to edit that partner link in JDev it won't work if your JDev doesn't support SQL Server. You'll have to regenerate the WSDL and XSD as needed and recreate the partner link.

  • How could I generate sample schema's after 11g r2 installation

    Hi,
    I appreciate if anybody let me know that how could I generate sample schema's after database installation (11g r2).
    Regards,

    hello
    you can download the script in the this link
    http://www.oracle.com/technology/obe/obe1013jdev/common/files/sample_schema_scripts.zip
    or
    sqlplus /nolog
    conn / as sysdba
    @mksample.sql
    regards
    zekeriya

  • GeneratingClasses and mappingFiles from database schema/ sql with ant/maven

    hi,
    I have an application using the the following ant script (it creates mapping files - hbms and sql schema for my database, basing on xdoclet for hibernate), (application also use spring beans in configuration file):
    <?xml version="1.0" encoding="UTF-8"?>
    <project name="demo" default="generate">
         <property file="build.properties" />
          <target name="init">
               <echo message="Clening..."/>
               <delete dir="target" failonerror="false"/>
               <echo message="Creating folders..."/>
            <mkdir dir="target"/>
            <mkdir dir="target/classes"/>
            <mkdir dir="target/jar"/>
               <echo message="Defining xdoclet2 ant task..."/>
            <path id="xdoclet2.task.classpath">
                <fileset dir="lib/xdoclet">
                    <include name="*.jar"/>
                </fileset>
            </path>
            <path id="project.classpath">
                <fileset dir="lib">
                    <include name="*.jar"/>
                </fileset>
            </path>
            <taskdef
                name="xdoclet2"
                classname="org.xdoclet.ant.XDocletTask"
                classpathref="xdoclet2.task.classpath"
                />
        </target>
         <target name="generate" depends="init" description="Cleans and builds everything.">
               <echo message="Generating hbms..."/>
            <xdoclet2>
                <fileset dir="source/src">
                    <include name="**/*Model.java"/>
                </fileset>
                <component
                    classname="org.xdoclet.plugin.hibernate.HibernateMappingPlugin"
                    destdir="target/hbm"
                    version="2.0"
                    />
            </xdoclet2>
               <echo message="Compiling..."/>
              <javac classpathref="project.classpath" destdir="target/classes"
                   srcdir="source/src">
              </javac>
               <echo message="Creating jar..."/>
              <jar destfile="target/jar/demo.jar">
                   <fileset dir="target/classes"/>
                   <fileset dir="resources"/>
                   <fileset dir="target/hbm"/>
              </jar>
            <path id="hibernate.task.classpath">
                <fileset dir="lib">
                    <include name="*.jar"/>
                </fileset>
                <fileset dir="target/jar">
                    <include name="*.jar"/>
                </fileset>
            </path>
               <echo message="Creating database schema..."/>
             <taskdef name="schemaexport"
                  classname="net.sf.hibernate.tool.hbm2ddl.SchemaExportTask"
                  classpathref="hibernate.task.classpath"/>
                  <schemaexport
                      properties="resources/hibernate.properties"
                      quiet="no"
                      text="no"
                      drop="no"
                      delimiter=";"
                      output="target/schema-export.sql">
                      <fileset dir="target/hbm">
                          <include name="**/*.hbm.xml"/>
                      </fileset>
                  </schemaexport>
         </target>
    </project>EXAMPLE MAPPING FILE:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
    <hibernate-mapping>
      <class table="DEMO_ADDRESS" name="amg.demo.model.AddressModel">
        <id unsaved-value="null" name="id">
          <generator class="native">
            <param name="sequence">id_seq</param>
          </generator>
        </id>
        <version unsaved-value="undefined" name="version" column="version" type="java.lang.Long"/>
        <property name="firstName"/>
        <property name="lastName"/>
        <property name="type" type="amg.demo.model.AddressTypeEnum"/>
        <property name="zipCode"/>
      </class>
    </hibernate-mapping>I wish I would know how to make an inverse operation - I mean having the sql database schema I should generate classes and propably the mapping xml-es.
    Could u please give me some example applications/ant or maven scripts with some database sql schemat or some not very complicated links to the tutorials concerning this problem?

    If you're using Eclipse check out some of the Hibernate tools. I have used these before:
    http://www.eclipse-plugins.info/eclipse/search.jsp?query=hibernate

  • Database schema generation from an XML schema

    From XDK FAQ:
    Question:
    Given a DTD, will XML SQL Utility generate the database schema?
    Answer:
    No. Due to a number of shortcomings of the DTD, this >functionality is not available. Once the W3C XML Schema >recommendation is finalized this functionality will become >feasible.Has this capability been implemented yet? I want to go from an XML schema to a database schema. If not is it still in the plan to do so? Are there other tools someone can recommend that can do this?
    Thanks,
    John

    The XML Schema support will be part of XDB in 9i Release 2.

  • Can't find my database schema, where do i place the database schema?

    hi folks,
    I was able to generate a database schema for my entity bean, but everytime i try to deploy the entity bean i get this error:
    SEVERE (23542): JDOCodeGenerator: Caught a RuntimeException :
    java.lang.RuntimeException: Could not find schema file SKX_LIVE_BLAZE on classpath EJB CL:
    i place it inside the SKXENTITYBEAN.jar file ..but it can't seem to find it.. where is it supposed to be placed?

    ok, i found out why it didnt' work ..i had the schema in this folder:
    skx\dbschema\SKX_LIVE_BLAZE
    so i had to use this for the schema name:
    <schema>skx/dbschema/SKX_LIVE_BLAZE</schema>
    previous i just did this:
    <schema>SKECHERS_LIVE_BLAZE</schema>
    I wish the documentation had given me some indication that if i had to include the folder path for the schema..

Maybe you are looking for

  • Problem with backing up my FCPX file

    Hi all, my FCPX "library file" is 1.5 terrabyte and I can't back it up. Every time I try and do it, it stops after approximately 100 gigabytes (the HD I'm trying to copy it to has more than enough free space. It's between two 4TB G-raids with approxi

  • Need to create a PDF with submit button for Wordpress Website.

    I need to create a restaurant's employment application in PDF form with fields that user can fill out and a submit button to send the form to a specified email. I then need to put this PDF online on client's website. Is this possible with ID?

  • Can't open the dmg file in Safari brower

    My Mac can't open dmg file in Safari brower.

  • Date Time Stamping issue

    When I use select xyz_Date from abc table in coldfusion cfquery tag, the out put comes as follows: CF5 - '05-MON-2007' CF8 - '2008-01-27 00:00:00.0' Note: The xyz_Date is stored without time stamp in the database. both running on 10.2.0.3 Oracle vers

  • Setting up mail account

    Apologies if this question has already been answered. After scanning 12 pages of forum entries my eyes started to cross. I am trying to set up my mail account for the first time and I'm getting a window that asks me to enter my password for stmp.mac.