-
1. Re: Jboss Seam Generates wrong mapping for char(2) type.
smithbstl Oct 10, 2007 11:26 AM (in response to bongosdude)Have you tried char[] or Character[]? If you can change your underlying database, it would probably be easier to to just use varchar2(2) mapped to a string. You can use Hibernate validators to ensure the length is 2 and it is not null. You can also use a check constraint in the database itself if you want to ensure the length and not null.
-
2. Re: Jboss Seam Generates wrong mapping for char(2) type.
bongosdude Oct 10, 2007 11:37 AM (in response to bongosdude)I have tried char[] but I got the same error. I have not tried Character yet. I cannot change the underlying database schema.
Thanks.
-B -
3. Re: Jboss Seam Generates wrong mapping for char(2) type.
bongosdude Oct 10, 2007 11:52 AM (in response to bongosdude)Can you explain why the annotation of @Column + @Length generated by seam-gen do not work?
-B -
4. Re: Jboss Seam Generates wrong mapping for char(2) type.
smithbstl Oct 10, 2007 11:59 AM (in response to bongosdude)How don't they work? Details please.
-
5. Re: Jboss Seam Generates wrong mapping for char(2) type.
bongosdude Oct 10, 2007 2:32 PM (in response to bongosdude)I do not have any problems with seam gen at all. But the deployment to Jboss failed with the above mentioned bug. By reading about JPA annotation with JEE 5.0 and Hibernate, I asked myself the same question. Why does it not work? Maybe: I am using jboss-4.2.0.GA and jboss-4.2.0.GA that comes with different Hibernate version than the one comes with jboss-seam-2.0.0CR2 (hibernate version 3.2.5)
How can I check hibernate version that comes with jboss-4.2.0.GA?
Thanks,
-b -
6. Re: Jboss Seam Generates wrong mapping for char(2) type.
smithbstl Oct 10, 2007 3:26 PM (in response to bongosdude)You can check the version by looking at the MANIFEST.MF file in Hibernate3.jar
I will tell you that its Hibernate 3.2.3.GA
You can try upgrading JBoss to 4.2.1 I don't think that is your issue. What happens when you try Character[] instead of String?
What happens when you remove the Hibernate Validations @NotNull and @Length?
Try getting the column mapping working first before you move on.
Also I am not sure @Length or even the JPA length property of @Column will work with a Character[] datatype because they are stated to work with String only.
Again this would all be easier with a varchar2/String but you said you are locked into char datatype. -
7. Re: Jboss Seam Generates wrong mapping for char(2) type.
bongosdude Oct 10, 2007 8:28 PM (in response to bongosdude)First I cannot change the datatype to varchar2 because it affects the other apps. Second, I am curious why it does not work with char(2).
I removed @NotNull and @Length(max = 2) but I got the same error. I have not tried Character[] yet. But I have tried char[] and I got the same error. Datatype char(2) is very basic datatype even though it is not very popular like varchar. Why does it not work with char()?
I keep trying. I am new to seam and I like very much the framework. This is my first experience with EJB3 and JPA so it is like learning.
Thanks again.
-B -
8. Re: Jboss Seam Generates wrong mapping for char(2) type.
pmuir Oct 11, 2007 9:27 AM (in response to bongosdude)You would be best taking mapping questions to the hibernate forums
-
9. Re: Jboss Seam Generates wrong mapping for char(2) type.
bongosdude Oct 11, 2007 8:35 PM (in response to bongosdude)Thanks. One more question. Is the default ManagerEntity in Jboss Hibernate. Are there any other EntityManagers that I can change to? Can I plug in Apache OpenJPA in Jboss?
-B -
10. Re: Jboss Seam Generates wrong mapping for char(2) type.
pmuir Oct 12, 2007 2:44 PM (in response to bongosdude)Ask this in the ejb3 forum. You can use other servers like glassfish
-
11. Re: Jboss Seam Generates wrong mapping for char(2) type.
fhh Oct 12, 2007 3:37 PM (in response to bongosdude)Use
@Column(columnDefinition="CHAR(2)"))
Regards
Felix -
12. Re: Jboss Seam Generates wrong mapping for char(2) type.
bongosdude Oct 16, 2007 1:17 PM (in response to bongosdude)Yes,
the columnDefinition = "char(2)" works.
How could i missed your hint.
Thanks
-B