Win a copy of Head First Android this week in the Android forum!

Konda Golamaru

Ranch Hand
+ Follow
since Dec 12, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Konda Golamaru


Hi Winston/Fred,

Thanks for the reply. Infact the COBOL field is COMP-3. // PIC S9(12)V9(6) // --- COMP-3
I have BigDecimal field in Java with value say 12.343434. so I want to convert into PackedDecimal.

Thanks,
Konda.
7 years ago
Hi,

I'm trying to convert a COBOL code into Java, have an issue converting BigDecimal into byte array.
The COBOL filed type is: // PIC S9(12)V9(6) (total length 18, integer part: 12, scale: 6)

The COBLO program returns the data for the above field: 12.332234 which is BigDecimal in Java. I need to append leading zeros(this case: 10) and convert into byte array.
The the final BigDecimal value should look like: 000000000012.332234. I converted BigDecimal into String, added leading zeros. When I contert into back to BigDecimal, all leading zeros are gone. Can any body help in regad this.

Thanks,
Konda.
// --- F
7 years ago
Could you post the spring context code here!
8 years ago
Hi,

I have the requirement where I need to construct a Map with all incoming entities into the processor. When the processing is done, I need to make the Map available to Listener where I need to look into each object in the map and remove the objects which are not required after further processing.

My question is: How to make the Map which is constructed in the processor be available to Listener. Is there any alternative approach(other than listener)? I am looking for a kind of delegator where I can hand over the map(which is constructed in the processor) to delegator so that I can do the final processing in the delegator e.g. updating to db or creating error report etc.

Thanks and any suggestions are welcome!
8 years ago
Hi ,

Down load the plug ins: Axis2_Service_Archiver_1.3.0, Axis2_Codegen_Wizard_1.3.0 and unzip them in plugins folder of Eclipse.
Then do Ctrl+N and click on the service archiver or code gen wizard dependign on what you want to do.

11 years ago
Hi Raj,

The info provided by you certainly would help. Thanks for your time.
As you mentioned, Please provide the more infor on SCEA as and when you get some time.


Konda Golamaru.
Hi Saravanan,

Could you please post the code you have used/developed to persist the said objects using one to many relation.

Thanks
Hi Mark,

Thanks for your reply.

I don't see the use of Initial Submisson Id being present in Applications table. Any way, The database was created 7 years ago and still we are using the same schema.

Coming back to the mapping, I think as you suggested, I need to more read on One to Many or Many to One mappings as The application can have multiple submissions/Multiple submissions can be created for a single application.

Thanks for your time.

Konda Golamaru.
Hi Paul,

Finally It works as I expected. I have changed the hbm ddl property value from create to update and it works.

<prop key="hibernate.hbm2ddl.auto">update</prop>


Now, it picks the next sequence value and also It creates the new record for each JUnit execution.

Your reply helped me to dig further on the issue and finally here we are.

Thanks again.
Hi Paul,

Thanks for your reply.

Please find the below session factory mapping info for the property mapping.
I have the ddl property set to create. Please let me know if you see any issues/errors with the mapping.


<property name="hibernateProperties">
<props>
<prop
key="hibernate.dialect">net.sf.hibernate.dialect.OracleDialect
</prop>
<prop key="hibernate.hbm2ddl.auto">create</prop>
</props>
</property>
I have the below JUnit test method.
When I execute the command: ant test -Dtestcase=ApplicationDAO, How come only one record being created in the database table though
I execute the command more than one time. Each time the applicationId is set to : 1.

Does not it create a record for each execution? Please help.

public void testSaveApplication() throws Exception{
//Configuration configuration = new Configuration(); // configuring hibernate
SessionFactory sessionFactory = (SessionFactory)ctx.getBean("sessionFactory") ;

Session session = sessionFactory.openSession();
Transaction tx = session.beginTransaction();

application=new Application();
application.setApplicationNumber("123");
application.setApplicationTitle("test_title");
application.setApplicationTypeId("8");
application.setMarketedName("marketed name");
application.setRenewalCycle("renewal cycle");
application.setComments("comments");
application.setInitialSubmissionId("12345678");
application.setAssociateApplicationId("81");
application.setLockedBy("Locked By");
application.setCreatedBy("spring");
application.setCreatedOn("31-JULY-2008");
application.setLastModifiedBy("spring");
application.setLastModifiedOn("31-JULY-2008");
application.setProcedureId("1");
application.setAtcCode("811");
application.setFilingAgencyId("4");
application.setParentNationalApplicationId("5");
application.setInitialApplicationSubTypeId("6");
application.setLockedBySessionId("Lock by session id");
application.setAppMedicinalProducts("6 mg");
application.setAssociateApplicationId("9");
application.setPlannedSubmissionsCount("5");
application.setActualSubmissionsCount("6");


dao.saveApplication(application);


assertNotNull("primary key assigned",application.getApplicationId());
log.info(application);
assertNotNull(application.getApplicationNumber());

log.debug("end of testSaveApplication");

Application app=dao.getApplication(application.getApplicationId());
log.debug(" app : "+app);

tx.commit();
session.flush();
session.close();
}
Hi,

I have created a oracle sequence(hibernate_seq) with start value 100.
And I have the below mapping in my .hbm.xml file to get the next sequence
value.

When I test using JUnit, I get the applicationId=1 where I would expect
applicationId to be 100 which is the current sequence value.

When I execute teh Junit test script 3 times, instead of creating 3 records,
the same record is overridden and the applicationId has the value 1.

Please let me know if I am doing some thing wrong?

<id name="applicationId" column="APPLICATION_ID" type="long" unsaved-
value="0">
<generator class="sequence">
<param name="sequence">hibernate_seq</param>
</generator>
</id>
Hi,

When I create an application, two tables have to be updated.

I have two tables with the columns given below.

Table-1: APPLICATIONS

Columns:

AP_ID -> PK (I use the APP_SEQ to get the next sequence id)
INITIAL_SUB_ID ->(This will be the PK of SUBMISSIONS Table. When I create the APPLICATION, I use SUB_SEQ to get the next sequnce id and insert a record into both APPLICATIONS and SUBMISSIONS Table)
APP_NUMBER etc..

Table-2: SUBMISSIONS

Columns

SUB_ID->PK
APP_ID->FK(Primary key of APPLICATIONS Table)
SUB_TITLE Etc..

1. When I create the application, I will be updating both APPLICATIONS, SUBMISSIONS Table(Currently I have a view which updates both the tables.)
2. When I create the submission, I will be updating only submissions table as the submission can be created for any of the existing application.


Question: I am planning to replace JDBC with Hibernate. I would appreciate, If any body can help/throw a suggetion for creating mapping file in the above scenario.

Thanks,
Konda Golamaru.
Hi ,

I am not clear on why c3 is not eligible for garbage collection though c3 receives null reference. Is not it that c3=null hence eligible for garbage collection.

Pls. explain.

Thanks,
Konda Golamaru.
Hi Marc,

Thank You. I think I am clear now.

--Konda Golamaru.