Menu

Joins ?

Viswa
2005-07-20
2013-04-25
  • Viswa

    Viswa - 2005-07-20

    Hi,
    I want to get values from more than one table... I'm new to this sql2java. Can any one help me to,how to get from more than one table... is it manual work? or sql2java has create separate method for that.... please guide me...

    Thanks in adv.

    Regards,
    Viswa

     
    • tcy

      tcy - 2005-07-21

      hi, I'm new to sql2java too, so I'm not too sure if what I say is correct...

      there is support for foreign key(this is the join you are looking for, right?)

      eg from the sample db on the site
      http://sql2java.sourceforge.net/copied/sample-hsqldb.sql

      delivery is link to customer and product

      // assuming a DeliveryBean has already been loaded
      // and you want to get the customer who made this order

      CustomerBean customerBean = DeliveryManager.getCustomerBean(deliveryBean.getCustomerId());

       
      • Viswa

        Viswa - 2005-07-22

        Thanx for guide.

        Viswa

         
    • nr

      nr - 2005-07-21

      right and let's say you want to load all the Products purchased by a Customer you can invoke:
      customerManager.loadProductViaDelivery(myCustomerBean)

      sql2java detected that Delivery is also a junction table between customer and products.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.