Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

how do I use orderby in weblogic 6.1?

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to use the orderby function in weblogic and the method in which
I have implemented I have shown in ejb-jar.xml and
weblogic-cmp-rdbms-jar.xml file shown below. Please do let me know if have
implemented it in the right way.
Thank you
Ronak Parekh
I am getthing the error:
Unable to deploy EJB: sempire_bc.jar from sempire_bc.jar:
Error while reading 'META-INF/weblogic-cmp-rdbms-jar.xml'. The error
was:
The finder method findAllOrderByRoleName of ejb RolesEJB cannot have
a null ejb ql value.
The finder method findAllOrderByUserName of ejb UsersEJB cannot have
a null ejb ql value.
This is my weblogic-cmp-rdbms-jar.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE weblogic-rdbms-jar PUBLIC
'-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB RDBMS Persistence//EN'
'http://www.bea.com/servers/wls600/dtd/weblogic-rdbms20-persistence-600.dtd'
>
<weblogic-rdbms-jar>
<weblogic-rdbms-bean>
<ejb-name>UsersEJB</ejb-name>
<data-source-name>UsersDB</data-source-name>
<table-name>USERS</table-name>
<field-map>
<cmp-field>iD</cmp-field>
<dbms-column>ID</dbms-column>
</field-map>
<field-map>
<cmp-field>userName</cmp-field>
<dbms-column>USER_NAME</dbms-column>
</field-map>
<field-map>
<cmp-field>userPass</cmp-field>
<dbms-column>USER_PASS</dbms-column>
</field-map>
<weblogic-query>
<query-method>
<method-name>findAllOrderByUserName</method-name>
<method-params>
<method-param>double</method-param>
</method-params>
</query-method>
<weblogic-ql>SELECT OBJECT(o) FROM o for UsersBean ORDERBY
o.userName</weblogic-ql>
</weblogic-query>
<weblogic-query>
<query-method>
<method-name>findAllOrderByUserPass</method-name>
<method-params>
<method-param>double</method-param>
</method-params>
</query-method>
<weblogic-ql>SELECT OBJECT(o) FROM o for UsersBean ORDERBY
o.userPass</weblogic-ql>
</weblogic-query>
</weblogic-rdbms-bean>
<weblogic-rdbms-bean>
<ejb-name>RolesEJB</ejb-name>
<data-source-name>RolesDB</data-source-name>
<table-name>ROLES</table-name>
<field-map>
<cmp-field>iD</cmp-field>
<dbms-column>ID</dbms-column>
</field-map>
<field-map>
<cmp-field>roleName</cmp-field>
<dbms-column>ROLE_NAME</dbms-column>
</field-map>
<field-map>
<cmp-field>roleDesc</cmp-field>
<dbms-column>ROLE_DESC</dbms-column>
</field-map>
<weblogic-query>
<query-method>
<method-name>findAllOrderByRoleName</method-name>
<method-params>
<method-param>double</method-param>
</method-params>
</query-method>
<weblogic-ql>SELECT OBJECT(o) FROM o for RolesBean ORDERBY
o.roleName</weblogic-ql>
</weblogic-query>
<weblogic-query>
<query-method>
<method-name>findAllOrderByRoleDesc</method-name>
<method-params>
<method-param>double</method-param>
</method-params>
</query-method>
<weblogic-ql>SELECT OBJECT(o) FROM o for RolesBean ORDERBY
o.roleDesc</weblogic-ql>
</weblogic-query>
</weblogic-rdbms-bean>
<create-default-dbms-tables>True</create-default-dbms-tables>
</weblogic-rdbms-jar>
This is my ejb-jar.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC
"-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
"http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<display-name>Business Component CMP 2.0</display-name>
<enterprise-beans>
<entity>
<display-name>Users Entity Bean</display-name>
<ejb-name>UsersEJB</ejb-name>

<local-home>com.sempire.builder.business_component.UsersHome</local-home>
<local>com.sempire.builder.business_component.Users</local>
<ejb-class>com.sempire.builder.business_component.UsersBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>users</abstract-schema-name>
<cmp-field><field-name>iD</field-name></cmp-field>
<cmp-field><field-name>userName</field-name></cmp-field>
<cmp-field><field-name>userPass</field-name></cmp-field>
<primkey-field>iD</primkey-field>
<ejb-local-ref>
<ejb-ref-name>UsersEJB</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>com.sempire.builder.business_component.UsersHome</local-home>
<local>com.sempire.builder.business_component.Users</local>
</ejb-local-ref>
<resource-ref>
<res-ref-name>jdbc/UsersDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<query>
<query-method>
<method-name>findAllWithConstraint</method-name>
<method-params />
</query-method>
<ejb-ql><![CDATA[SELECT OBJECT(o) FROM users AS o]]></ejb-ql>
</query>
<query>
<query-method>
<method-name>findAllOrderByUserName</method-name>
<method-params />
</query-method>
<ejb-ql></ejb-ql>
</query>
<query>
<query-method>
<method-name>findAllOrderByUserPass</method-name>
<method-params />
</query-method>
<ejb-ql></ejb-ql>
</query>
</entity>
<entity>
<display-name>Roles Entity Bean</display-name>
<ejb-name>RolesEJB</ejb-name>

<local-home>com.sempire.builder.business_component.RolesHome</local-home>
<local>com.sempire.builder.business_component.Roles</local>
<ejb-class>com.sempire.builder.business_component.RolesBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>roles</abstract-schema-name>
<cmp-field><field-name>iD</field-name></cmp-field>
<cmp-field><field-name>roleName</field-name></cmp-field>
<cmp-field><field-name>roleDesc</field-name></cmp-field>
<primkey-field>iD</primkey-field>
<ejb-local-ref>
<ejb-ref-name>RolesEJB</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>com.sempire.builder.business_component.RolesHome</local-home>
<local>com.sempire.builder.business_component.Roles</local>
</ejb-local-ref>
<resource-ref>
<res-ref-name>jdbc/RolesDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<query>
<query-method>
<method-name>findAllWithConstraint</method-name>
<method-params />
</query-method>
<ejb-ql><![CDATA[SELECT OBJECT(o) FROM roles AS o]]></ejb-ql>
</query>
<query>
<query-method>
<method-name>findAllOrderByRoleName</method-name>
<method-params />
</query-method>
<ejb-ql></ejb-ql>
</query>
<query>
<query-method>
<method-name>findAllOrderByRoleDesc</method-name>
<method-params />
</query-method>
<ejb-ql></ejb-ql>
</query>
</entity>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>UsersEJB</ejb-name>
<method-name>*</method-name>
</method>
<method>
<ejb-name>RolesEJB</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
 
This cake looks terrible, but it tastes great! Now take a bite out of this tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic