Ali Hussain

Ranch Hand
+ Follow
since Jun 19, 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 Ali Hussain

I have unidirectional manytomany relation that is not working. Teacher has a reference (collection) for students, but the student does not have reference to the Teacher.

When I merge(teacher) like this getJpaTemplate().merge(teacher), with a new student added to the collection, the relation is not updated in the join table (teacher_student) and there are no exceptions either. However both teacher and student are saved properly in their tables. I have done a lot of searching but still not able to find the solution...please help!

<blockquote>code:
<pre name="code" class="core">
@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
public abstract class Teacher implements Comparable, Serializable {

@Id
protected TeacherId teacherId;

@ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, fetch = FetchType.EAGER)
@BatchSize(size = 3)
protected List<Student> students;

public addOrUpdateStudent(Student student) {
if (students == null) {
students = new ArrayList<Student>();
}
int index = students.indexOf(student);
if (index == -1) {
students.add(student);
} else {
students.set(index, student);
}

}
...
}
</pre>
</blockquote>

<blockquote>code:
<pre name="code" class="core">
@Entity
public class Student implements Comparable, Serializable {
@Id
@GeneratedValue
private int id;
...
}
</pre>
</blockquote>

I am using hibernate 3.2.1.ga, postgres 8.2-504.jdbc3 and java 1.6.0.
Are you sure you want to use a hibernate annotation @CollectionOfElements in your code (I assume you want your code to be JPA compatible so you can change to any other implementation without changing the code)?
This would also work:



See this bug report and the workaround
Note sure but it seems to be a bug in hibernate release. A possible workaround could be: private Date[] quittingDates;

Let us know if you find some other solution.
Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore. Dream. Discover." - Mark Twain
16 years ago
Seems like an easy decision: Move on to a new job. As you have written, your current job is not good enough, both in terms of money and work.
16 years ago

'm a bit unsure of my plan - specifically #4. Is it common for companies to wait 2 months for a new employee to begin work?


Depends on where you are. In Scandinavia it is quite normal for employers to wait for 3 months. In the UK it is 1 month.
16 years ago
I feel the soul of cricket has been seriously hurt by the Woolmer incident. Its time that the government of these countries take control over these betting and match fixing issues. And remember its not just subcontinent. Some South African players e.g. Gibbs were also involved some years ago. As long as players are not willing to be sold, there is nothing to be bought for the bookies.
[ March 24, 2007: Message edited by: Ali Hussain ]
16 years ago
What dont you look for a Java job? In the current market, it should not be a problem for you to find a Java job that pays well.
16 years ago
Mark Twain:
- Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore. Dream. Discover."

GodFather:
The only wealth in this world is children; more than all the money, power on earth, you are my treasure.
16 years ago
Another option is to consider a more product specific career in IT. For example becoming a specialist in an Application Server. These do not change as often as other Java frameworks and mostly you will be doing configuration work than programming.
17 years ago
Do not just select a project just because it is an "open source" project. Make sure that you work with a project that has some "potential" for industrial use. Look for projects that use some of the hot technologies like spring, hibernate, jsf, ejb3, bpel etc.
17 years ago
Introduction to Hedge (finance) has a quick intro about hedging.
[ February 02, 2007: Message edited by: Ali Hussain ]
17 years ago
Not sure that it can help you but one thing you should check (given that you have copied your .aar file to the service directory of axis2.war file):
- You should place axis2-saaj-1.1.1.jar (found in axis's lib directory) in WebLogic's classpath.
17 years ago
Switched from JRockit to Sun JVM and got a better error message. A class was missing.
17 years ago