Views

I have four different views in oracle that gets the values for each specific row. For example:View 1 returns values for Row 1View 2 returns values for Row 2and so on...My question is will I be able to use this views to display all four rows at the same time?
[293 byte] By [iamleia] at [2007-11-26 21:39:55]
# 1
Technically, this isn't a java question, but I'll bite anyway...You can use a SQL UNION to do this.
bckrispia at 2007-7-10 3:23:58 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2
What I meant is if this is possible in Java, since you can add a view in mapping.xml... is it possible to combine the views in Java?
iamleia at 2007-7-10 3:23:58 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3
can you more specific for 'mapping.xml' ?
p_epia at 2007-7-10 3:23:58 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 4

for example a mapping.xml can be done this way:

<class name="com.test.bo.TestBean" identity="siteCode">

<cache-type type="none"/>

<map-to table="SRT.VW_TEST" />

<field name="siteCode" type="java.lang.String" >

<sql name="SITE_CODE" type="varchar" />

</field>

<field name="countryCode" type="java.lang.String" >

<sql name="COUNTRY_CODE" type="varchar" />

</field>

<field name="locCode" type="java.lang.String" >

<sql name="LOC_CODE" type="varchar" />

</field>

</class>

can you map 4 different views at the same time in one bean? for example:

<class name="com.test.bo.TestBean" identity="siteCode">

<cache-type type="none"/>

<map-to table="SRT.VW_TEST" />

<map-to table="SRT.VW_TEST1" />

<map-to table="SRT.VW_TEST2" />

<field name="siteCode" type="java.lang.String" >

<sql name="SITE_CODE" type="varchar" />

</field>

<field name="countryCode" type="java.lang.String" >

<sql name="COUNTRY_CODE" type="varchar" />

</field>

<field name="locCode" type="java.lang.String" >

<sql name="LOC_CODE" type="varchar" />

</field>

</class>

iamleia at 2007-7-10 3:23:58 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 5

are you using castor ?

check your dtd file that you are use for mapping.xml (for example mapping.dtd)

In that file you can search for 'map-to' element, if this 'map-to' is ended with '*' that mean you can do for more than one table, otherwise no.

but if you are using castor , you cannot do that, the alternative way see reply #1

p_epia at 2007-7-10 3:23:58 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...