Bruno Frascino

Ranch Hand
+ Follow
since Jul 22, 2003
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 Bruno Frascino

Hello,

First time using ibatis. I am having problem trying to passe more than one parameter to my query.

I have got:


And my DAO implementation:


It seems to be right, I get no error, but it is not because it doesn't return any record!! I think there is something to do with the multiple parameters, because when I hardcode one of the parameters (#employeeId# or #userId# ) it returns the data I need.

Any help!?

I also don't know how to enable the sql statements output, that could maybe help.

Thanks!
Hi Mark,

I don't know how to explain the architecture, but I believe it is truly attached because any changes in the object, even not calling em.merge();, JPA still update the object.
I tried using the em.clear() method before updating, and now I am getting an error: Transaction is not active
This update method I am implementing is big, when I just update without validating heaps of condition I got no error!

So now I trying to get rid of some useless code... this is a refactoring project..

Anyway, thanks again!
Hi Mark,

I retrieved this entity A from database so it means it is ATTACHED, in other words, it is being managed by persistence context.
So I thought detaching it, using:

em.clear() - Clear the persistence context, causing all managed entities to become detached.

But this entity manager method detaches ALL entities... I am just wondering, could I detach only one?

Thanks again!
Hello all,

Let's suppose an entity class A
I retrieve A from database and populate my update screen.
I change some fields from A
Then I want to update it, but I need to do some validation based on the original values. So when I pass A to my update method, I get A id, and get A again from Database by ID. So now I have 2 entities, will they be different? I mean, will they have different values?(because had done some changes)

Thanks
Hello all,

I have got an exciting problem.
I have got the following native query:



As you see, this will return 4 different dates for me, and they need to populate another entity instead of date_table, which i got the values from.
So, this is the question:

"How can I select values from a table A to populate actually not the entity related to table A but an entity B related to table B?"

I am trying to use native query and resultSetMapping, but I keep getting an error, invalid column name from Hibernate. I don't know how could I do it not using nativequery.

I'd appreciate any help, thanks!
Hello,

I have a class that needs to be mapped, I am using hibernate. But this class doesn't represent any specific table in the database, it contains fields from different tables. I have no idea how to do that, some help!?
Thanks!
Hello there,

My database is Oracle, and my id column value is an Oracle sequence, this sequence is executed by a trigger, so, before each row is inserted this trigger use this sequence to get the id value. So I am confused in which id strategy generation should I define in my entity class.

1 - native
2 - sequence (oracle sequence name, or let hibernate do it?)

Thanks
Hello there,

Reverse engineering with hibernate tools doesn't have the feature of defining a 1 to 1 relationship? So I need to do it manually, i mean write the annotations inside my entity class?

Hibernate Tools and 1to1

Cheers

Originally posted by Chris Hendy:
Either remove your setting of the id in hibernate and let the database trigger handle it under all circumstances.

Or change the trigger to get the next_val from the sequence and assign it to the column only if :new.ID IS NULL



Hello there,
I have got a similar problem, this database can't be touched, Oracle, so they have sequences for each id. And I am doing reverse engineering, so I at first I did:

But in the documentation says that I should use only these options:

AUTO - either identity column, sequence or table depending on the underlying DB
TABLE - table holding the id
IDENTITY - identity column
SEQUENCE - sequence

And I heard something about using "native" also. Now I am confused, what I need is let the database take care of my table ID, hibernate shouldn't care about it. Which option?
Thanks!
Hello there,

I am not really sure, but can I use hibernate annotations with java 1.3?
I think it is too old, but exactly why not?

Thanks!
Hello,

Sorry guys, not my fault.
This problem wasn't making any sense.
I am using Eclipse Europa with JBossTools to do all my reverse engineering, and sometimes Eclipse just close itself because of an error, so I though this problem could be something related to JBossTools. So, somehow my changes in my reveng.xml file wasn't been noticed by hibernate, i started refreshing my app and I used the source view of reveng.xml file to edit it, instead of the fancy graphical jbosstool and now it is working!!!

Thanks anyway!
Hello folks,

I have got an Oracle database with no primary keys defined, just unique constraints. So when I do my reverse engineering for example in a ACCOUNT table I have the following Java model "reversed":

Account


AccountId


So, I tried to define a primary key within my reveng.xml:



But it doesn't work. I realized that the <table> tag is not been read. I can go like this:



Trying to exclude this column but I still get the two classes Account, AccountId with my VERSION column.

Anybody has got any similar problem?
One interesting thing, is that I did the same in a PostgreSQL database and it worked, I could define my primary keys, change my class name and everything... it seems to be something with Oracle.. just guessing..

Anyway, I would appreciate very much any help!
Cheers!
Thanks Merrill,

Now it is working... but I'm confused, cause I've got an example of web.xml like this:



and it's working properly... but when I tried to do it, I failed.
That's ok, for now, most important thing is make this application work, but when get spare time I'll check this issue again.

Thanks mate!!
17 years ago
Hi everybody,

I'm trying to separate my struts-config.xml in more files, but I got an error:


19:32:54,546 ERROR [ActionServlet] Parsing error processing resource path /WEB-INF/struts-config.xml,
/WEB-INF/struts-estatistica.xml
java.lang.NullPointerException
at org.apache.struts.action.ActionServlet.initApplicationConfig(ActionServlet.java:857)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:455)



Here is my web.xml code where I define my other .xml(struts-estatistica.xml):



Here is my struts-estatistica.xml:


Anybody can help me?! What Am I forgetting to do?
Does have anything to be done at the original struts-config.xml??

Thanks in advance!
17 years ago
Hi there,

Does anybody has a good struts book sugestion for a beginner, or a tutorial!?

thanks in advance.
17 years ago