This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
try
{
Integer t = 2;
String str = t.toString();
BigDecimal bd = new BigDecimal(str);
entiHome h = entiUtil.getHome();
enti ben = h.create(bd, "George", "USA", "sweden");
pw.println("Bean Created.....!!!");
pw.println("Name : "+ben.getName());
pw.println("Address : "+ben.getAddress());
pw.println("Company : "+ben.getCompany());
}
catch(Exception e)
{
System.out.println("The error is : "+e.toString());
}
}
The bean is created but there is no data in the database.
I have attached the structure of the files in Eclipse[color=blue] . Can anyone help me in this issue..........??.......it has become a nightmare..............!!!
please allow me to know if any more details is required.....
[/color]
Can you please help me to know what I should need to do in order to insert data into the database....(The Bean has been generated successfully but there is no data in the database)....
.....I am using JBOSS server.....my ejb-jar.xml is given below.....please allow me to know if I need to modify it....or need to do something more to insert data in the database...........
<description><![CDATA[EntityEJB generated by eclipse wtp xdoclet extension.]]></description>
<display-name>EntityEJB</display-name>
<enterprise-beans>
<!-- Session Beans -->
<!--
To add session beans that you have deployment descriptor info for, add
a file to your XDoclet merge directory called session-beans.xml that contains
the <session></session> markup for those beans.
-->
<ejb-class>entpkg.entiCMP</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.math.BigDecimal</prim-key-class>
<reentrant>false</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>entiSCHEMA</abstract-schema-name>
<cmp-field id="CMPAttribute_1">
<description><![CDATA[<!-- begin-user-doc --> CMP Field id Returns the id]]></description>
<field-name>id</field-name>
</cmp-field>
<cmp-field id="CMPAttribute_2">
<description><![CDATA[<!-- begin-user-doc --> CMP Field name Returns the name]]></description>
<field-name>name</field-name>
</cmp-field>
<cmp-field id="CMPAttribute_3">
<description><![CDATA[<!-- begin-user-doc --> CMP Field address Returns the address]]></description>
<field-name>address</field-name>
</cmp-field>
<cmp-field id="CMPAttribute_4">
<description><![CDATA[<!-- begin-user-doc --> CMP Field company Returns the company]]></description>
<field-name>company</field-name>
</cmp-field>
<primkey-field>id</primkey-field>
<query>
<query-method>
<method-name>findAll</method-name>
<method-params>
</method-params>
</query-method>
<ejb-ql><![CDATA[SELECT OBJECT(a) FROM entiSCHEMA as a]]></ejb-ql>
</query>
<!-- Write a file named ejb-finders-MyBean.xml if you want to define extra finders. -->
</entity>
<!--
To add entity beans that you have deployment descriptor info for, add
a file to your XDoclet merge directory called entity-beans.xml that contains
the <entity></entity> markup for those beans.
-->
<!-- Message Driven Beans -->
<!--
To add message driven beans that you have deployment descriptor info for, add
a file to your XDoclet merge directory called message-driven-beans.xml that contains
the <message-driven></message-driven> markup for those beans.
-->
</enterprise-beans>
<!-- Relationships -->
<!-- Assembly Descriptor -->
<!--
To specify your own assembly descriptor info here, add a file to your
XDoclet merge directory called assembly-descriptor.xml that contains
the <assembly-descriptor></assembly-descriptor> markup.
-->
<assembly-descriptor id="AssemblyDescriptor_1">
<!--
To specify additional security-role elements, add a file in the merge
directory called ejb-security-roles.xml that contains them.
-->
<!-- method permissions -->
<!--
To specify additional method-permission elements, add a file in the merge
directory called ejb-method-permissions.ent that contains them.
-->
<!-- transactions -->
<!--
To specify additional container-transaction elements, add a file in the merge
directory called ejb-container-transactions.ent that contains them.
-->
<!-- finder transactions -->
<!-- message destinations -->
<!--
To specify additional message-destination elements, add a file in the merge
directory called ejb-message-destinations.ent that contains them.
-->
<!-- exclude list -->
<!--
To specify an exclude-list element, add a file in the merge directory
called ejb-exclude-list.xml that contains it.
-->
</assembly-descriptor>
</ejb-jar>
Thank You.....
Manjunath Gajula
Greenhorn
Joined: Dec 21, 2011
Posts: 12
posted
0
Can you let me know what piece of code is there in your bean class?