• Post Reply Bookmark Topic Watch Topic
  • New Topic

Type Mapping in MySQL  RSS feed

 
meka toka
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Environment:
-------------
I am using JBoss 3.0.6, MySQL 3.23.55, EJB 2.0 , EMP 2.0
Problem:
--------
I am having trouble doing the type-mapping for the data type java.lang.Object in standardjbosscmp-jdbc.xml.
<java-class>java.lang.Object</java-class>
<jdbc-type>Blob</jdbc-type>
<sql-type>LongBlob</sql-type>
The file by default has above mapping, but when i use that i am getting the error
org.jboss.deployment.DeploymentException: Error while creating table; - nested throwable: (java.sql.SQLException: General error, message from server: "BLOB column 'start_ip' used in key specification without a key length")
The table which it is trying to create has a primary-key class, and the primary-key class is made of 3 columns start_ip, end_ip, subnet_mask. All 3 are of type java.net.InetAddress. The type mapping in xml doesnt have a mapping for InetAddress so, JBoss will map it to java.lang.Object.
Solution:
--------
I am supposed to specify a key legnth, as per
http://www.ehrlichorg.com/02f-tech/ref-mysql.htm
something like
CREATE INDEX part_of_name ON customer (name(10))
But how can i specify key legnth in EJB using CMP ?
Regards
Meka Toka
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!