Prashant Langade

Ranch Hand
+ Follow
since Jul 01, 2009
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 Prashant Langade

Thank you very much Rob for the quick help.

But i think by using this (tooltip) code, user is required to hover the mouse over the text in a column cell to see it. but what i want is to show the excess contents(more than widht of column) of the cell to bleed
into next column.

I have a tree structure in place. meaning there would a single value in first row in first column, when i click over it,the next row's second column value gets showed up...like that
so i can afford to show the excess contents over to the next column.

do you think by any chance,it is possible?


Thanks
Prashant
4 years ago
Hi

I have a Jtable which shows contents on each row. but the row contents which are bigger than the width of the column gets shown as "BlahBlah.." (basically getting showed up as .. in the end)

User has to manually increase the width of the column to see those extra contents.

For e.g if the row contents are ABCDEFGHI and the widht of the column for that row is sufficient enough to show only ABCDEF of that, then it will show up as something like "ABCD.."

Now my requirement is to show the complete contents over to next column on the same row.

Note: I could simply add the code to show the widht of the column to adjust according to largest row content for that column . But unfortunately this is not what is required.

Any pointers/help is appreciated.

Thanks
Prashant
4 years ago
Hi All

I am a newbie to Swing. However i need to understand the following concepts from swing.

Renderers,Editors and Model

I have already couple of times gone through the link from oracle. http://docs.oracle.com/javase/tutorial/uiswing/components/table.html

But i am finding it bit difficult to understand it programatically(how the things work).

Can any one help me with any other links/pdf's which are simple to understand for these three concepts?

Thanks
Prashant
5 years ago
Thanks a lot for the reply Winston..

However my problem is that i have that 0.000 value in double and not in String
so can not really make use of the solution provided by you.. is there any way other than this?

Thanks
Prashant
7 years ago
Hi

I have a scenario where i need to know the number of digits after decimal point of a double value.

Lets say
i have



Now i would want to write a code to know how many digits the double value has after decimal point(i.e .)
which in this case is 4.

I tried with

but this gives me result as 0.0 and hence the

comes as 1.

Please help me.

Thanks in advance
Prashant
7 years ago
Hi

I am writing data to excel sheet using POI

Now when i am trying to write the BigDecimal value to a cell using following code


where

partBean.getBestBuyFactor()

is a BigDecimal value 1 but it is getting written to the cell as 1.000
because POI is treating it as a

text

and not as

number



so i tried setting the cellType as

cell.setCellType(Cell.CELL_TYPE_NUMERIC);

but still POI is treating it as a string.

So can any one please help me why this is happening and how to resolve it?

I am attaching the screenshot of the excel sheet data.

Thanks in advance
Prashant
Hi

I have a problem while displaying a image in excel sheet.

I can see the image getting displayed when i use


but if i want to access/display that image using the context path like


I am not able to see that image getting displayed.

"WebDnldCtr" is the name of the project(main folder) which has "WebContent" folder which in turn has "Common" folder which contains "conf_en_US.gif" image.

Attaching herewith the snapshot of the image.

Can any one please help me?

Prashant
8 years ago
Hi,

I am encountering

java.lang.VerifyError: arguments are not type compatible

exception when i try to run my web application.
Can anybody please help me with what could be wrong with the application code/installation?

Thanks and Regards
Prashant
8 years ago
Hi,

I am trying to run the application and i am getting
bad major version at offset=6]: java.lang.UnsupportedClassVersionError:

exception.

I followed this link java.lang,UnsupportedClassVersionError and came to know that if the project is compiled with
higher level than the runtime can support,then it gives this exception.

I am using RAD 7.5. can any one please help me check this?

Thanks and Regards
Prashant
8 years ago
Thanks a lot sean for pointing to the issue...

I did that change along with putting

cascade="save-update"

in


and it worked...

i really apreciate you ...
Hi Sean,

I did some modification to the code and now i can see the queries getting executed.

Here are the modifications done.






Here is the exception


INFO: Not binding factory to JNDI, no JNDI name configured
Hibernate: insert into ADRPTMT.PRODUCT_FAMILY (PRODUCT_FAMILY_DSC, ANNUAL_USAGE_HRS_TM, MACHINES_PER_CATALOG_CNT, PRODUCT_FAMILY_ID) values (?, ?, ?, ?)
Hibernate: update ADRPTMT.PRODUCTS_ALIVE set PRODUCT_FAMILY_ID=? where PRODUCT_FAMILY_ID=? and PARTS_CATALOG_NUM=? and ALIVE_YR=?
Apr 14, 2011 4:20:15 PM org.hibernate.type.NullableType nullSafeSet
INFO: could not bind value '1' to parameter: 4
Apr 14, 2011 4:20:15 PM org.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: 20000, SQLState: 07000
Apr 14, 2011 4:20:15 PM org.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: At least one parameter to the current statement is uninitialized.
Apr 14, 2011 4:20:15 PM org.hibernate.event.def.AbstractFlushingEventListener performExecutions
SEVERE: Could not synchronize database state with session
Throwable occurred: org.hibernate.exception.SQLGrammarException: could not insert collection: [com.deere.domain.ProductFamily.productAliveList#TESTPRODFAMID]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:65)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.persister.collection.AbstractCollectionPersister.recreate(AbstractCollectionPersister.java:1058)
at org.hibernate.action.CollectionRecreateAction.execute(CollectionRecreateAction.java:26)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:243)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:227)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:144)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:296)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1009)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:356)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at com.deere.hibernate.ProductMaintain.main(ProductMaintain.java:48)
Caused by: java.sql.SQLException: At least one parameter to the current statement is uninitialized.
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source)
at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:23)
at org.hibernate.persister.collection.AbstractCollectionPersister.recreate(AbstractCollectionPersister.java:1039)
... 10 more
Caused by: java.sql.SQLException: At least one parameter to the current statement is uninitialized.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
... 21 more
Caused by: ERROR 07000: At least one parameter to the current statement is uninitialized.
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
at org.apache.derby.impl.sql.execute.BaseActivation.throwIfMissingParms(Unknown Source)
at org.apache.derby.exe.acf81e0010x012fx53a1xf477x0000001f62d81.execute(Unknown Source)
at org.apache.derby.impl.sql.GenericActivationHolder.execute(Unknown Source)
at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
... 15 more
org.hibernate.exception.SQLGrammarException: could not insert collection: [com.deere.domain.ProductFamily.productAliveList#TESTPRODFAMID]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:65)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.persister.collection.AbstractCollectionPersister.recreate(AbstractCollectionPersister.java:1058)
at org.hibernate.action.CollectionRecreateAction.execute(CollectionRecreateAction.java:26)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:243)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:227)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:144)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:296)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1009)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:356)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at com.deere.hibernate.ProductMaintain.main(ProductMaintain.java:48)
Caused by: java.sql.SQLException: At least one parameter to the current statement is uninitialized.
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source)
at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:23)
at org.hibernate.persister.collection.AbstractCollectionPersister.recreate(AbstractCollectionPersister.java:1039)
... 10 more
Caused by: java.sql.SQLException: At least one parameter to the current statement is uninitialized.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
... 21 more
Caused by: ERROR 07000: At least one parameter to the current statement is uninitialized.
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
at org.apache.derby.impl.sql.execute.BaseActivation.throwIfMissingParms(Unknown Source)
at org.apache.derby.exe.acf81e0010x012fx53a1xf477x0000001f62d81.execute(Unknown Source)
at org.apache.derby.impl.sql.GenericActivationHolder.execute(Unknown Source)
at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
... 15 more
Apr 14, 2011 4:20:15 PM org.hibernate.util.JDBCExceptionReporter logWarnings
WARNING: SQL Warning: 10000, SQLState: 01J01
Apr 14, 2011 4:20:15 PM org.hibernate.util.JDBCExceptionReporter logWarnings

Thanks a lot for replying Sean,

But we can map a Bag for ArrayList.

Because there is no concept of Bag in Java.it is just the hibernate data type.

Please have a look at this Bag example

Here you can see that they have shown that Bag can be mapped with java.util.ArrayList

Hi

I am facing same strange issue.

Here is the code snippet

The main java class.



The ProductFamily pojo mapped to PRODUCT_FAMILY table




The ProductAlive pojo mapped to PRODUCTS_ALIVE table

PRODUCT_FAMILY has one to many relationship with PRODUCTS_ALIVE table



PROUDCTS_ALIVE has three primary keys(Composite primary keys).
The corresponding separate pojo ProductAliveKey representing it.



HBM files

ProductFamily.hbm.xml



ProductAlive.hbm.xml



The database structure




I am getting following exception when i try to run main class.


org.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.deere.domain.ProductFamily.setProductAliveList
at org.hibernate.tuple.PojoEntityTuplizer.setPropertyValuesWithOptimizer(PojoEntityTuplizer.java:215)
at org.hibernate.tuple.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:185)
at org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:3232)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:253)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:167)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:114)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186)
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:559)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:547)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:543)
at com.deere.hibernate.ProductMaintain.main(ProductMaintain.java:46)
Caused by: net.sf.cglib.beans.BulkBeanException: org.hibernate.collection.PersistentBag incompatible with java.util.ArrayList
at com.deere.domain.ProductFamily$$BulkBeanByCGLIB$$29c24265.setPropertyValues(<generated>)
at org.hibernate.tuple.PojoEntityTuplizer.setPropertyValuesWithOptimizer(PojoEntityTuplizer.java:212)
... 14 more
Caused by: java.lang.ClassCastException: org.hibernate.collection.PersistentBag incompatible with java.util.ArrayList
... 16 more



Can anyone please help me where am i going wrong?

Thanks and Regards
Prashant
Hi

I want to install plugin for hbm file generation in RAD 7.5.

I tried following the steps menstioned at Hibernate Auto-generate hbm files

i.e download and extract the hibernate-tools.jar at plugins folder and restart RAD.
but i am unable to see File -> New -> Other -> Hibernate -> Hibernate Configuration File options..

Can any one please let me know how to install?

Thanks and Regards
Prashant

8 years ago
Hi

I am also facing the same issue.

Here is the code snippet

The main java class.



The ProductFamily pojo mapped to PRODUCT_FAMILY table




The ProductAlive pojo mapped to PRODUCTS_ALIVE table

PRODUCT_FAMILY has one to many relationship with PRODUCTS_ALIVE table



PROUDCTS_ALIVE has three primary keys(Composite primary keys).
The corresponding separate pojo ProductAliveKey representing it.



HBM files

ProductFamily.hbm.xml



ProductAlive.hbm.xml



The database structure




I am getting following exception when i try to run main class.


org.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.deere.domain.ProductFamily.setProductAliveList
at org.hibernate.tuple.PojoEntityTuplizer.setPropertyValuesWithOptimizer(PojoEntityTuplizer.java:215)
at org.hibernate.tuple.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:185)
at org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:3232)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:253)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:167)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:114)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186)
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:559)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:547)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:543)
at com.deere.hibernate.ProductMaintain.main(ProductMaintain.java:46)
Caused by: net.sf.cglib.beans.BulkBeanException: org.hibernate.collection.PersistentBag incompatible with java.util.ArrayList
at com.deere.domain.ProductFamily$$BulkBeanByCGLIB$$29c24265.setPropertyValues(<generated>)
at org.hibernate.tuple.PojoEntityTuplizer.setPropertyValuesWithOptimizer(PojoEntityTuplizer.java:212)
... 14 more
Caused by: java.lang.ClassCastException: org.hibernate.collection.PersistentBag incompatible with java.util.ArrayList
... 16 more