File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Hibernate One-to-many with Set not updating table as expected.. please help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate One-to-many with Set not updating table as expected.. please help" Watch "Hibernate One-to-many with Set not updating table as expected.. please help" New topic
Author

Hibernate One-to-many with Set not updating table as expected.. please help

Nandish Sri
Ranch Hand

Joined: Jan 19, 2004
Posts: 45
Please help me why I am getting this error: Column 'cust_code' cannot be null

Here is my code:

Database Info:

CREATE TABLE `collection` (
`cust_code` varchar(10) NOT NULL,
`collection_code` int(10) NOT NULL auto_increment,
`paidDate` date default NULL,
`paidAmount` double(10,0) default NULL,
`viewMonth` varchar(10) default NULL,
`viewYear` varchar(4) default NULL,
`paidMonth` varchar(10) default NULL,
`paidYear` varchar(4) default NULL,
PRIMARY KEY (`collection_code`),
CONSTRAINT `cust_code` FOREIGN KEY (`cust_code`) REFERENCES `cust_info` (`code`)
) ENGINE=MyISAM AUTO_INCREMENT=95 DEFAULT CHARSET=utf8;


CREATE TABLE `cust_info` (
`code` varchar(10) NOT NULL,
`name` varchar(20) default NULL,
`amount` double(10,0) default NULL,
`contactNbr` varchar(12) default NULL,
`address` varchar(50) default NULL,
`comments` varchar(100) default NULL,
`status` varchar(10) default NULL,
PRIMARY KEY (`code`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;



Errors I am getting are:
in localhost-date.log


System.out.put log:




CustMonthlyUpdate.java


CustMonthlyUpdate.js



CustDAO.updateCardInfo method:


CustInfoVO.java [Omitted other getter/setter methods]



Nandish
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate One-to-many with Set not updating table as expected.. please help