Tong Wang

Ranch Hand
+ Follow
since Jun 20, 2005
Merit badge: grant badges
For More
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 Tong Wang

I am evaluating Griffon now. One thing I noticed is that in the Griffon mailing list archive, the latest thread was dated June 24th, 2010, which was almost 8 months ago. That seems to me not much is going on with Griffon. Anyone has idea what's going on with Griffon?
13 years ago
The order of the elements in the tag doesn't matter. Both forms below are correct.

In my case, after adding standard.jar to WEB-INF/lib, Eclipse 3.5 didn't pick up the change. So, I just entered a space in the JSP file, then removed it, then saved the JSP file, and it worked. Basically, the JSP didn't change, just edit it so it's "refreshed".

Marco Antonio Toscano Freire wrote:Hello Guys

There isn't any bug in Eclipse, the problem is the order of elements. Bellow show us either two forms:

Correct
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>


Incorrect

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>


http://javecuador.blogspot.com
http://martosfre.blogspot.com

Ok, I see. So you'll need a unidirectional one-to-one mapping. User will have a reference to UserTheme, but UserTheme will NOT reference User. Since you mentioned that you can NOT alter user table, you will have to use @PrimaryKeyJoinColumn, meaning that User table and UserTheme table will have the same primary key.

Not a problem. Actually I just figured out another way of storing the object graph: first use xml serialization to marshal the graph to xml, then store the xml in string format. But I am not sure what is the best mapping for large xml strings.
RuleModel is not meant to be queried, or used by any DB tools. Setting its references to other objects to transient is also not acceptable, because I need to store the complete object graph and later restore it.
Have you thought about an embeddable class? Like this:

No, I don't want to use @Embed. As I said, the RuleModel itself contains references to a dozen other classes, mapping all those classes would be a lot work and really unnecessary, because I will never run a SQL query on them, I just need to be able to load/store the ruleModel as a whole thing. So I just want to store the object instance of a RuleModel in a single field; the only thing I can think of is to store the binary form of the object instance as a @BLOB, but not sure if this will work.
Sorry for the confusion. Here is a short code snippet that helps to explain this:



I have an entity Promotion, which has 3 simple fields (id, name, description) and all 3 will be mapped to DB. So far so good. Problem is with the 4th field, ruleModel, which is an instance of RuleModel and when constructed at runtime, it will contain object instances of a dozen other classes. I don't want to map RuleModel to a DB table, because that is a lot extra work and also unnecessary. I just want to store the ruleModel object instance into DB and then be able to load ruleModel from DB and restore the object instance in memory.
I have an object graph (created at runtime as a result of user input) associated with an entity. I don't need to map this object graph to/from DB. I just need to be able to save/load it to/from DB with the entity. So, what is the best practice to store it? I appreciate if someone could shed a light on this.
Hello everyone,

I have an EJB3 entity bean like this:


where RuleModel is a POJO and its object graph could get very complex, so I don't want to map it to persistence, instead I want to directly store the object instance of RuleModel along with my Promotion entity bean.

I've been reading the EJB3 docs and it looks like there is a @Lob annotation for large objects, it could be either a CLOB or BLOB, depending on the type of the object.

So, for a BLOB, if I mark the RuleModel class as Serializable, can I persist it to DB and load it later on? Will it work? Anyone actually used @Lob this way?

As you know, there are tools for creating a mapping between Java objects and XML docs, this means you can convert your Java object instance to an XML string and then store it as a CLOB. Can someone please recommend a good Java-XML mapping framework?

Between the above two methods (if the first one works), which one is better in terms of easy to program/maintain and performance at runtime?

Your help will be greatly appreciated.
Hello everyone,

I have an EJB3 entity bean like this:

where RuleModel is a POJO and its object graph could get very complex, so I don't want to map it to persistence, instead I want to directly store the object instance of RuleModel along with my Promotion entity bean.

I've been reading the EJB3 docs and it looks like there is a @Lob annotation for large objects, it could be either a CLOB or BLOB, depending on the type of the object.

So, for a BLOB, if I mark the RuleModel class as Serializable, can I persist it to DB and load it later on? Will it work? Anyone actually used @Lob this way?

As you know, there are tools for creating a mapping between Java objects and XML docs, this means you can convert your Java object instance to an XML string and then store it as a CLOB. Can someone please recommend a good Java-XML mapping framework?

Between the above two methods (if the first one works), which one is better in terms of easy to program/maintain and performance at runtime?

Your help will be greatly appreciated.
I see, thank you.

Also, in JBoss Eclipse, for each project, you can configure how the file will be packaged: what go into a WAR, what go into a JAR, etc. Eclipse 3.3 doesn't seem to have this option. So, to produce a EAR for deployment, do I have to use some external build tool, like Ant or Maven?
Hi everyone,

I am new to Eclipse 3.3 (having been using JBoss Eclipse). While playing with the hibernate4gwt sample project, I noticed a launch configration file with the ".launch" file name suffix:



I wonder if someone could help me understand this or point me to some documents.

Thanks,
Tong

(Escaped the XML to make it visible - PC)
[ December 11, 2007: Message edited by: Paul Clapham ]
Hi,

I have a bunch of entities with persistence annotations and all worked well. Now that I need to remove the annotation and instead, use orm.xml to define the mapping. I did that for one of the entities and tried to deploy to JBoss 4.2.0 GA, but got an exception.

Here is my orm.xml:


And here is the exception I got:


Any help is appreciated.
Thanks for your reply, Mark.

I had the cascade type set to ALL. I just like to find out what's the proper way to update one of a bean's children programmatically.