How to connect two different tables from different server?

Dear all expert,
I need to develop a report where i need to connect 2 different tables from 2 different servers. For examples:
BUT000 tables from CRM and KNKK from R3.
Is it possible to do so? Because i try to link these 2 tables together and when i preview the report, it run very slow and sometime it hang. I did not get any result.
Thank You.

Moved to SAP Integration kit forum
Appears you are using SAP data sources.
And yes you can but the linked field types must match and be able to be converted into the WHERE portion of the SQL. Click on Database, Show SQL... and see if there is one. If not CR can't figure out how to so it brings all data client side and filters on the second pass.
Thank you
Don

Similar Messages

  • How to merge two search button from different criteria

    How to merge two search button from different criteria
    this image show the question
    http://s24.postimg.org/4algthuj9/1111.jpg
    two different criteria for the same view and I need to merge it in one button as when I click
    on the button search result give from two criteria parameters

    You can!t using af:query. the af:query component comes as is. If you can't do it through the properties, you probably can't do it at all.
    As in your other thread, the way to go is to program your own search form. This way you can use a layout and functionality you like.
    For this you create a form with input fields for the values you are searching for, put them on hte page in a way you like and in the end by hitting on a button (e.g. called Search) map all inputfields to parameters of a service method you defined in your application module or VO. This service method then executes a view criteria returning all matches in the default iterator (just as if you had used af:query.
    Timo 

  • How to Import/Export database tables from one server to other in oracle8i

    Hello friend,
    Please can any one tell me how to import/export groups of database tables from one server with oracle to another using VB.net. It would be nice if some one can provide some code of it.
    I am a software developer and I am in middle of a large project development, in which I need to export a large oracle database from one server to another efficiently.
    Its very urgent so please someone help me.

    At command prompt (source db)
    set ORACLE_SID=db_name
    exp system/password@db_name full=y buffer=104857600 file=(c:\file1.dmp, c:\file2.dmp....) log=c:\exp.log filesize=2000M
    Then ftp the export dump files (in binary) to the other server or copy to target server over the network.
    At command prompt (target db)
    set ORACLE_SID=db_name
    imp system/password@db_name full=y ignore=y buffer=104857600 file=(c:\file1.dmp, c:\file2.dmp....) log=c:\imp.log filesize=2000M
    If the path names of the datafiles are going to be different in the target server (as compared to the source), then precreate the tablespaces before import. Set buffer value accordingly.
    Message was edited by:
    FeNiCrC_Neil

  • How to set two values equal from different recordset?

    I have created a posts recordset and a comments recordset
    the comments table has a post_id to link the comment to a specific post through setting it equal to the id field in the posts table
    so that whenever a post loads the comment whos post_id is equal to the id of the post should load
    I know that if one advanced recordset combining the two tables is created I can set the values to be eqal in the where clause but doing so causes an error in the url parameters of the page.
    Plz help guys and thanks in advance.

    Just do this in advanced recordset
    SELECT *
    FROM posts JOIN comment
    ON posts.post_id = comment.post_id
    WHERE posts.post_id = colname
    Add 1 variable
    name: colname
    type: numeric
    default value: -1
    runtime value: $_GET['pid']
    so in browser URL it will be post_view.php?pid=1

  • How to join tables from different databases (DBLink/DB connection )

    Hello,
    i have an issue and i hope you could help me to solve it. My problem is: I want to create native sql select which joins two tables from different DB (both of them are ORACLE, one of them internal, another one - external). I have found several notes and posts, but without any success. Db connection exists in dbcon table, so this part of my problem has been solved.
    I would like something like that:
    select * from table1@xxx inner join table2.
    i can not split this select into two separate ones, because both tables store over 30 mln. entries and i do not want to create any copies of them.
    Br,
    dez

    Hi,
    you might need to create a DB-Link on DB level and use EXEC SQL.
    Lots of stuff on google about this, like
    Oracle DBLink ( external database )
    Volker

  • How do you join two tables from different Oracle schemas using a subquery

    I am trying to join two tables from different Oracle schemas using a subquery. I can extract data from each of the tables without a problem. However, when I combine the select statements using a subquery I get the Oracle error *'ORA-00936: missing expression'*. Since each SELECT statement executes on its own without error I don't understand what is missing. The result set I am trying to get is to match up the LINE_ID from PDTABLE_12_1 in schema DD_12809 with the MAT_DESCRIPTION from table PDTABLE_201 in schema RA_12809.
    The query is as follows:
    sql = "SELECT [DD_12809].[PDTABLE_12_1].LINE_ID FROM [DD_12809].[PDTABLE_12_1] JOIN " _
    + "(SELECT [RA_12809].[PDTABLE_201].MAT_DESCRIPTION " _
    + "FROM [RA_12809].[PDTABLE_201]) AS FAB " _
    + "ON [DD_12809].[PDTABLE_12_1].PIPING_MATER_CLASS = FAB.PIPING_MATER_CLASS"
    The format of the query is copied from a SQL programming manual.
    I also tried executing the query using a straight JOIN on the two tables but got the same results. Any insight would be helpful. Thanks!
    Edited by: user11338343 on Oct 19, 2009 6:55 AM

    I believe you are receiving the error because you are trying to JOIN on a column that doesn't exist. For example you are trying to join on FAB.PIPING_MATER_CLASS but that column does not exist in the subquery.
    If you want to do a straight join without a subquery you could do the following
    SELECT  DD_12809.PDTABLE_12_1.LINE_ID
    ,       FAB.MAT_DESCRIPTION
    FROM    DD_12809.PDTABLE_12_1
    JOIN    RA_12809.PDTABLE_201    AS FAB ON DD_12809.PDTABLE_12_1.PIPING_MATER_CLASS = FAB.PIPING_MATER_CLASS  HTH!

  • Joining two fact tables with different dimensions into single logical table

    Hi Gurus,
    I try to accomplish in Oracle Business Intelligence 11.1.1.3.0:
    F1 (D1, D2 and D3)
    F2 (D1 and D2 and D4)
    And we want to build a report F1 F2 D1 D2 D3 D4 to have data for:
    F1 that match only for D1-D2-D3
    and data for
    F2 that match only D1-D2-D4
    all that in one row, so D3 and D4 are not common dimensions.
    I can only do:
    F3 (D1, D2)
    F4 (D1, D2 and D4)
    And report
    F3 F4 D1,D2,D4 (all that in one row, and only D4 is not a common dimension)
    Here is the very good example how to accomplish the scenario 1
    http://108obiee.blogspot.com/2009/08/joining-two-fact-tables-with-different.html
    But looks like it does not work in 11.1.1.3.0
    I get
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 14025] No fact table exists at the requested level of detail: [,,Clients,,Day,ROI,,,,EW_Names,,,,,,,,,,,,,,,,,]. (HY000)
    I am sure I set up everything correctly as advised in the blog but it works with only one not a common dimension
    Is it a bug in 11.1.1.3.0 or something?
    Thanks,
    Kate

    Thanks for all your replies.
    Actually, I've tried the solutions you guys mentioned. Generally speaking, the result should be displayed. However, my scenario is a little bit tricky.
    table Y's figures are not the aggregation of table X for D dimension. Instead, table Y's figures include not only D dimension total, but also others (others do not mean A, B, C dimension). For example, table Y stores all food's figure, while table X stores only drink's figure. D dimension is only about drink's detail. In my scenario, other foods' figure is not provided.
    So, even if I set D dimension to all/total for table X, table X's result is still not the same as table Y.
    Indeed, table Y does not have a column key to join to D dimension's key. So, if I select D dimension and table Y's measures at the same time in BI Answer, result returns no data. Hence, I can't compare table X and table Y's results with selection of D dimension.
    Is there any solution to solve this problem?
    Edited by: TomChan on Jun 3, 2009 9:36 AM

  • Accessing tables from different schema in CDS and AMDP

    Hi All,
    We are working on a HANA system which has several schema replicated from SAP R/3/Non SAP systems. We have BW 7.4 SP9 deployed on the same system and accessing the HANA views using latest BW virtual objects such as Open ODS , Composite providers etc.
    We are also using the BW system for few ABAP based data processing developments. We are currently accessing HANA views in ABAP programs by creating dictionary views based on external HANA views.
    We would like to however use recent possibilities of CDS and AMDP for better life cycle management of ABAP based solutions. The open SAP course on this subject was of very good help. Thanks a lot "open SAP team" for that. I would however have few open questions,
    As I understand AMDP gives us full flexibility of writing sql procedures within ABAP development environment, but can we access tables from different schema into AMDP code. If yes, then sample code would help.
    If the answer of first question is yes, then how do we manage transports between development and production systems where the schema names would be different. Currently in open HANA developments, such transport is manged using Schema mapping.
    Can I also use different schema tables in CDS views.
    We are updating few tables in ABAP dictionary after applying processing logic in ABAP program as detailed in step 1. With the new approach using AMDP, can we directly update database schema tables which will give us an optimization advantage.
    New ABAP HANA program interfaces are quite promising and we would like to use them to optimize many data intensive applications.
    Thanks & Regards,
    Anil

    Hi Anil,
    I can only answer 1. and 2. (and would be interested into 3. as well):
    1.
    Yes you can access tables from a different schema and also HANA views. In this case no 'using' is needed.
    Examples:
        RESULT = SELECT
        FROM
              "SAP_ECC"."T441V" AS t,
              "_SYS_BIC"."tmp.package/AFPO" AS a.
        WHERE ...
    2. In this case, if you need schema mapping: You could use HANA (projection) views which just forward to a different schema, also see example.
    Best regards,
    Christoph

  • No Easy Way to Join on Tables from Different Schemas

    Hi,
    The company policy does not allow to join on tables from different schemas or use db links...
    I'm tasked to come up with a Perl script that does exactly that - allows for the SELECT statement to do several joins on 3 different schemas. In addition 1 of the schemas is on the different host altogether.
    Upping the privileges for my user and allowing db links is not an option...Can someone, please help me to understand on a conceptual level how would I use Perl and what logic would it have and what would it (perl) do?
    Thank you,

    Court in the wrong job... ;)
    It's like a librarian who is a hard rock artist maintaining the silence in the premises. ;)
    My dear friend, i don't think this is the right place for your requirement. This is the PL/SQL forum. If you have any problem related PL/SQL or SQL you can place that here.
    Regards.
    Satyaki De.

  • Performance between two partitionned tables with different structure

    Hi,
    I would like if there is a difference between two partitionned tables with different structure in term of performance (access, query, insertions, updates ).
    I explain myself in detail :
    I have a table that stores one value every 10 minutes in a day (so we have 144 values (24*6) in the whole day), with the corresponding id.
    Here is the structure :
    | Table T1 |
    + id PK |
    + date PK |
    + sample1 |
    + sample2 |
    + ... |
    + sample144 |
    The table is partionned on the column date, with a partionned every months. The primary key is based on the columns (id, date).
    There is an additionnal index on the column (id) (is it useful ?).
    I would like to know if it is better to have a table with just (id, date, value) , so for one row in the first table we'll have 144 rows in the future? table. The partition will already be on the columns (id, date) with the index associated.
    What are the gains or loss in performance with this new structure ( access, DMLs , storage ) ?
    I discuss with the Java developers and they say it is simpler to manage in their code.
    Oracle version : Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    Thanks & Regards
    From France
    Oliver
    Edited by: 998239 on 5 avr. 2013 01:59

    I mean storage in tablespaces and datafiles on disk.
    Can you justify please and give me concrete arguments why the two structures are equivalent ( except inserting data in T(id, date,value))
    because i have to make a report.i didnt say any thing like
    two structures are equivalent ( except inserting data in T(id, date,value)i said
    About structure : TABLE1(id, date, value) is better than TABLE1(id, date, sample1, .... sample144)because
    1) oracle has restriction for numbers of column. Ok you can have 144 columns now but for future if you must have more than 1000 columns , what will you do?
    2) Restrictions on Table Compression (Table compression is not supported for tables with more than 255 columns.)
    3) store same type values on diffrent columns is bad practise
    http://docs.oracle.com/cd/B28359_01/server.111/b28318/schema.htm#i4383
    i remember i seen Toms article about this but now i cant find it sorry ((( if i found i will post here

  • Best way to connect two fact tables when no conformed dimension exists

    Can anyone please elaborate how would I connect two fact table without any conformed dimension. Let say FACTA, FACTB. FACTB is related to a dimension "StatusDim". I want to select the count of all FACTA item which are related to FACTB items with
    a particular status. I have found the following article but just wondering whether it is the best practise to connect two fact tables directly.
    http://bifuture.blogspot.com/2011/11/ssas-selecting-facts-with-reference.html
    Thank you

    Hi Ahsan,
    After read the blog you posted, I think it's a pretty good solution to create a view in the relational database or a named query in the Data Source View containing as the the columns in FACTA and FACTB. Then build a dimension from it, setting the "Null processing"
    property (you have to click the "plus" two times for the "Key Columns" property of the attribute in BIDS to access this property) to "UnknownMember". And then use this dimension for the many-to-many relationship. Dimensions from FactA can benefit of the reference
    relationship between FactA and FactB and therefore a powerful solution it is.
    Regards,
    Charlie Liao
    If you have any feedback on our support, please click
    here.
    Charlie Liao
    TechNet Community Support

  • Regarding Passing two internal Tables from Driver Program to Smartform

    hi all,
              I am Passing Two Internal Tables from Driver Program to Smartform it is going to dump and message is showing like this " one of the parameters eded according to the interface description was not specified ".
              When i am passing one Internal Table Output is coming Perfectly. Is there any restriction for passing of internal tables.
    Regards
    Rami

    HI,
    Check the names specified in the smartfrom and FM whcih you are calling in the driver program. Both might be different....

  • Hibernate query...how to connect two databases...

    hi i m new to hibernate..
    i created two tables..
    1st table is catalog:
    2nd table is acctinfo
    //HBM file is :
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
    <hibernate-mapping>
    <class name="hibernate.example.Catalog" table="catalog">
    <id name="id" type="integer" column="ID">
    <generator class="increment"/>
    </id>
    <property name="journal" type="string" column="JOURNAL"/>
    <property name="publisher" type="string" column="PUBLISHER"/>
    <property name="edition" type="string" column="EDITION"/>
    <property name="title" type="string" column="TITLE"/>
    <property name="author" type="string" column="AUTHOR"/>
    <bag name="accinfo" cascade="all" >
    <key column="ID"/>
    <one-to-many class="hibernate.example.Acctinfo"/>
    </bag>
    </class>
    <class name="hibernate.example.Acctinfo" table="acctinfo">
    <id name="id" type="integer" column="ID">
    <generator class="increment"/>
    </id>
    <property name="account" type="string" column="ACCOUNT"/>
    <property name="password" type="string" column="PASSWORD"/>
    <property name="balance" type="string" column="BALANCE"/>
    </class>
    </hibernate-mapping>
    ///******************getter setter file is::****************
    package hibernate.example;
    public class Acctinfo
         int id;
         String account;
         String password;
         String balance;
         public Acctinfo()
         public void setId(int id)
              this.id = id;
         public int getId()
              return id;
         public void setAccount(String account)
              this.account = account;
         public void setPassword(String password)
              this.password = password;
         public void setBalance(String balance)
              this.balance = balance;
         public String getAccount()
              return account;
         public String getBalance()
              return balance;
         public String getPassword()
              return password;
    //********************2nd getter setter file is:***********************
    package hibernate.example;
    import java.util.List;
    public class Catalog
    int id;
    String journal;
    String publisher;
    String edition;
    String title;
    String author;
    private List accinfo;
    public Catalog()
    public void setId(int id)
    this.id = id;
    public int getId()
    return id;
    public void setJournal(String journal)
    this.journal = journal;
    public String getJournal()
    return journal;
    public void setPublisher(String publisher)
    this.publisher = publisher;
    public String getPublisher()
    return publisher;
    public void setEdition(String edition)
    this.edition = edition;
    public String getEdition()
    return edition;
    public void setTitle(String title)
    this.title = title;
    public String getTitle()
    return title;
    public void setAuthor(String author)
    this.author = author;
    public String getAuthor()
    return author;
    public void setAccinfo(List accinfo)
    this.accinfo = accinfo;
    public List getAccinfo()
    return accinfo;
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package hibernate.example;
    import hibernate.example.Acctinfo;
    import hibernate.example.Catalog;
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
    import java.util.ListIterator;
    import org.hibernate.Query;
    import org.hibernate.SQLQuery;
    import org.hibernate.Session;
    import org.hibernate.SessionFactory;
    import org.hibernate.Transaction;
    import org.hibernate.cfg.Configuration;
    public class CatalogClient
         Session session = null;
         SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
         public static void main(String str[])
              CatalogClient clc = new CatalogClient();
              //clc.saveData();
              //clc.deleteData();
              //clc.showData();
              clc.updateData();
         public void showData()
              try
                   session =sessionFactory.openSession();
                   String SQL_QUERY ="select id, journal, publisher, edition, title, author from catalog";
                   // String SQL_QUERY ="select c.ID, c.JOURNAL, c.PUBLISHER, c.EDITION, c.TITLE, c.AUTHOR, a.ACCOUNT, a.PASSWORD,a.BALANCE from catalog c, ACCTINFO a where c.ID = a.ID";
                   SQLQuery query = session.createSQLQuery(SQL_QUERY);
                   System.out.println("*** query : *** "+ query);
                   //for(ListIterator it=query.list().listIterator();it.hasNext();)
                   for (ListIterator lit = query.list().listIterator(); lit.hasNext();)
                        Object[] row = (Object[]) lit.next();
                        /*System.out.println("ID: " + row[0]);
                        System.out.println("Title: " + row[1]);
                        System.out.println("Author: " + row[2]);
                        System.out.println("Isbn: " + row[3]);
                        System.out.println("Pages: " + row[4]);
                        System.out.println("Copyright: " + row[5]);
                        System.out.println("Cost: " + row[6]);
                        System.out.println("******NEXT****************");
    Object[] row = (Object[]) it.next();*/
                        System.out.println("ID: " + row[0]);
                        System.out.println("JOURNAL: " + row[1]);
                        System.out.println("PUBLISHER: " + row[2]);
                        System.out.println("EDITION: " + row[3]);
                        System.out.println("TITLE: " + row[4]);
                        System.out.println("AUTHOR: " + row[5]);
                        System.out.println("acc: " + row[6]);
                        System.out.println("pass: " + row[7]);
                        System.out.println("bal: " + row[8]);
                        System.out.println("***************************");
                   session.close();
              catch(Exception e)
                   System.out.println(e.getMessage());
         public void saveData()
              session =sessionFactory.openSession();
              Transaction transaction = null;
              transaction = session.beginTransaction();
              Catalog catalog = setBean();
              //System.out.println("before save");
              session.save(catalog);
              //System.out.println("after save");
              transaction.commit();
              session.flush();
              session.close();
         public void updateData()
              session =sessionFactory.openSession();
              Catalog catalog = new Catalog();
              catalog.setId(2);
              catalog.setAuthor("manoj");
              catalog.setJournal("java");
              catalog.setEdition("1st");
              catalog.setPublisher("indiabulls");
              catalog.setTitle("java Servlet");
              session.update(catalog);
              session.flush();
              session.close();
         public void deleteData()
              session =sessionFactory.openSession();
              Catalog catalog = new Catalog();
              catalog.setId(3);
              session.delete(catalog);
              session.flush();
              session.close();
         public static Catalog setBean()
              Acctinfo accinfo = new Acctinfo();
              accinfo.setAccount("MANOJ1");
              accinfo.setPassword("orbis");
              accinfo.setBalance("1000");
              List list = new ArrayList();
              list.add(accinfo);
              Catalog catalog = new Catalog();
              catalog.setJournal("india");
              catalog.setPublisher("indiabulls");
              catalog.setEdition("ist");
              catalog.setTitle("orbis");
              catalog.setAuthor("manoj");
              catalog.setAccinfo(list);
              return catalog;
    //********************CFG FILE IS ******************
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
    <hibernate-configuration>
    <session-factory name="session">
    <property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>
    <property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
    <property name="hibernate.connection.url">jdbc:oracle:thin:@172.16.31.25:1521:BOMBAY</property>
    <property name="hibernate.connection.username">mumbai</property>
    <property name="hibernate.connection.password">mumbai123</property>
    <!-- Set AutoCommit to true -->
    <property name="connection.autocommit">true</property>
    <property name="dialect">org.hibernate.dialect.OracleDialect</property>
    <!-- Mapping files -->
    <mapping resource="Catalog.hbm.xml"/>
    </session-factory>
    </hibernate-configuration>
    **********************error i m facing is :************************
    0 [main] WARN net.sf.ehcache.config.Configurator - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/C:/Documents%20and%20Settings/d.poonam/Desktop/hibernate/lib/ehcache-1.1.jar!/ehcache-failsafe.xml
    1188 [main] WARN org.hibernate.impl.SessionFactoryObjectFactory - Could not bind factory to JNDI
    javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
         at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
         at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
         at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
         at javax.naming.InitialContext.getNameParser(Unknown Source)
         at org.hibernate.util.NamingHelper.bind(NamingHelper.java:52)
         at org.hibernate.impl.SessionFactoryObjectFactory.addInstance(SessionFactoryObjectFactory.java:90)
         at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:247)
         at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1043)
         at hibernate.example.CatalogClient.<init>(CatalogClient.java:24)
         at hibernate.example.CatalogClient.main(CatalogClient.java:27)
    please help me out....
    thanks in advance..
    if u know how to connect two tables plz let me know..
    its urgent....

    I made this work with MySQL. Adapt to your situation as needed. - %
    package hibernate.model;
    import hibernate.util.HibernateUtils;
    import hibernate.model.Catalog;
    import hibernate.model.Account;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    import org.hibernate.Session;
    import hibernate.util.HibernateUtils;
    import static junit.framework.Assert.assertEquals;
    import static junit.framework.Assert.assertNotNull;
    public class CatalogTest
       private static final Log LOGGER = LogFactory.getLog(CatalogTest.class);
       public static void main(String[] args)
          Session session = null;
          try
             session = HibernateUtils.getSessionFactory().getCurrentSession();
             session.beginTransaction();
             int rowsBefore = HibernateUtils.getRowCount(session, Catalog.class);
             assertEquals("should not have any Catalogs", rowsBefore, 0);
             Catalog catalog = new Catalog("test title");
             catalog.addAccount(new Account(100));
             catalog.addAccount(new Account(200));
             Long id = (Long) session.save(catalog);
             assertNotNull("generated id should not be null", id);
             LOGGER.info("returned id: " + id);
             session.getTransaction().commit();
             LOGGER.debug("transaction committed");
          catch (Exception e)
             LOGGER.error(e);
             session.getTransaction().rollback();
    package hibernate.model;
    import java.io.Serializable;
    import java.text.NumberFormat;
    public class Account implements Serializable
       private Long id;
       private int balance;
       public Account()
          this(null, 0);
       public Account(int balance)
          this(null, balance);
       public Account(Long id, int balance)
          this.id = id;
          this.balance = balance;
       public Long getId()
          return id;
       private void setId(Long id)
          this.id = id;
       public int getBalance()
          return balance;
       private void setBalance(int balance)
          this.balance = balance;
       public boolean equals(Object o)
          if (this == o)
             return true;
          if (!(o instanceof Account))
             return false;
          Account account = (Account) o;
          return !(id != null ? !id.equals(account.id) : account.id != null);
       public int hashCode()
          int result;
          result = (id != null ? id.hashCode() : 0);
          result = 31 * result + balance;
          return result;
       public String toString()
          return new StringBuilder().append("Account{").append("id=").append(id).append(", balance=").append(NumberFormat.getCurrencyInstance().format(balance)).append('}').toString();
    <?xml version="1.0"?>
    <!DOCTYPE hibernate-mapping PUBLIC
          "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
          "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
    <hibernate-mapping package="hibernate.model" default-access="field" default-lazy="true">
       <class name="Account" table="accounts">
          <id name="id" column="account_id">
             <generator class="native"/>
          </id>
          <property name="balance" column="balance"/>
       </class>
    </hibernate-mapping>
    package hibernate.model;
    import java.io.Serializable;
    import java.util.Set;
    import java.util.HashSet;
    import java.util.Collections;
    public class Catalog implements Serializable
       private Long id;
       private String title;
       private Set<Account> accounts;
       public Catalog()
          this(null, "", Collections.EMPTY_SET);
       public Catalog(String title)
          this(null, title, Collections.EMPTY_SET);
       public Catalog(Long id, String title, Set<Account> accounts)
          this.id = id;
          this.title = title;
          this.accounts = new HashSet<Account>(accounts);
       public Long getId()
          return id;
       private void setId(Long id)
          this.id = id;
       public String getTitle()
          return title;
       private void setTitle(String title)
          this.title = title;
       public Set<Account> getAccounts()
          return accounts;
       private void setAccounts(Set<Account> accounts)
          this.accounts = accounts;
       public void addAccount(Account account)
          this.getAccounts().add(account);
       public void removeAccount(Account account)
          this.getAccounts().remove(account);
       public boolean equals(Object o)
          if (this == o)
             return true;
          if (!(o instanceof Catalog))
             return false;
          Catalog catalog = (Catalog) o;
          return !(id != null ? !id.equals(catalog.id) : catalog.id != null);
       public int hashCode()
          return (id != null ? id.hashCode() : 0);
       public String toString()
          return new StringBuilder().append("Catalog{").append("id=").append(id).append(", title='").append(title).append('\'').append(", accounts=").append(accounts).append('}').toString();
    <?xml version="1.0"?>
    <!DOCTYPE hibernate-mapping PUBLIC
          "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
          "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
    <hibernate-mapping package="hibernate.model" default-access="field" default-lazy="true">
       <class name="Catalog" table="catalogs">
          <id name="id" column="catalog_id">
             <generator class="native"/>
          </id>
          <property name="title" column="title"/>
          <set name="accounts" cascade="all">
             <key column="catalog_id"/>
             <one-to-many class="hibernate.model.Account"/>
          </set>
       </class>
    </hibernate-mapping>
    <!DOCTYPE hibernate-configuration PUBLIC
         "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
         "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
    <hibernate-configuration>
         <session-factory>
          <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
          <property name="connection.url">jdbc:mysql://localhost:3306/hibernate?autoReconnect=true</property>
          <property name="connection.username">hibernate</property>
          <property name="connection.password">hibernate</property>
          <property name="connection.pool_size">1</property>
          <property name="dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>
          <property name="show_sql">true</property>
          <property name="generate_statistics">true</property>
          <property name="query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>
          <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
          <property name="cache.use_minimal_puts">false</property>
          <property name="cache.use_query_cache">false</property>
          <property name="order_updates">false</property>
          <property name="hbm2ddl.auto">create-drop</property>
          <property name="current_session_context_class">thread</property>
          <mapping resource="hibernate/persistence/hibernate/Account.hbm.xml"/>
          <mapping resource="hibernate/persistence/hibernate/Catalog.hbm.xml"/>
         </session-factory>
    </hibernate-configuration>

  • How to connect two external monitors to a Mac Book Pro?

    How to connect two external monitors to a Mac Book Pro?

    Not as is, but  Matrox makes a peripheral that enables connecting more than one external monitor - matrox.com.

  • How do I move a table from one schema to another schema on Oracle XE?

    How do I move a table from one schema to another schema on Oracle XE?

    Hi,
    I tried to use the insert/select statement that you had given, it did not work.
    The error is ORA-00913: too many values.
    But finally what I did was, I went into the system schema where the table was and generated the DDL through the utilities and afterwards I imported them into the schema that I am currently working on. It solved the problem!
    However I am still curious to know why the insert/select statement did not work? Do you know any site/tutorial which gives a real time example?
    Thank you
    Skye

Maybe you are looking for

  • Print to PDF issues after 11.0.03 Update

    Hello, Installed on our site we have Adobe Reader XI as part of out basic build (ie. every PC has it) and Adobe Acrobat X Pro (as part of the CS5.5 Master Collection) for those users that request it (meaning that we have both versions installed side

  • Cannot restart computer without 10 to 20 BSODs ever since I upgraded to Windows 8.1

    Hi, I have a Samsung ATIV Book 8 laptop (2013 model). It has been working great on Windows 8. In May, I upgraded to 8.1 and restarting has been nearly impossible ever since. I can leave my computer in sleep mode for days and come back and it would wo

  • Delivery order for sub-contract processing scenario

    Hi experts, We got a requirement from our users to sub-contract certain production processing steps (or called external processing per SAP). Same part number would be used for the goods issue and goods receipt. But would like to make the delivery for

  • Print - Stroke Border

    Print - Stroke Border needs a finer setting than 1pt. ½pt, ¼pt and hairline should be added to the options. Roy

  • Scripts using PL/SQL

    Hi all, I am learning PL/SQL and wants to know whether it is possible to write stored procedures to take DB backup using RMAN. If yes can any one guide me in refering some documents which gives information and examples for writing such type of proced