tabiul mahmood

+ Follow
since Sep 17, 2009
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by tabiul mahmood

Hi All AOP Expert,

This is more of a design question on AOP Usage. The classic usage of AOP has always been in security/logging/transaction etc. I am thinking of using AOP in more business context. I have a method that I need to call across multiple modules in some specific method. Is AOP appropriate here? The business method is not a pure Cross Cutting concern that affects all methods in the application but it does impact significant places. My thinking is that by using AOP can a centralize my code in a single place and prevent tight coupling as maybe I will change the signature of the method and then I will need to change all code that is calling that method. A friend of mine said that AOP should not be used as AOP should only be used non domain or business context.

What do you guys think?


9 years ago

I would like to know more about Dynamic Weaving in AspectJ. Is it supported? If yes, how does it work. Is it discussed in the book AspectJ in Action.

9 years ago
session.getTransaction().commit. Here the session is your Hibernate Session that you can get from SessionFactory
Yes, you can use annotation if you do not want to use hbm.xml file. Please refer to this link for more information of annotation
Not sure why you need the SubQuery

HQL = "from File where size>0" seems sufficient to me as this query will return only Files whose size is > 0. Unless the data that you provided is wrong and there are cases where the File Name is same but the size maybe 0 or other values
Why do you need Oracle10g dialect? Hibernate already provides

  • org.hibernate.dialect.Oracle9Dialect
  • org.hibernate.dialect.OracleDialect

  • which should be sufficient for your requirement as Hibernate does not need any exotic Oracle syntax for it's functionality. If you want to do any database specific query then you can use normal SQL in hibernate
    My feeling is that there is some configuration mistake that Teena is making that is causing this problem. JSF and Hibernate is two different framework that serves different purpose and I personally used them together and there are no problems using them together.
    The relationship between the Bid and Item table is through a foreign key Item_Id I presume

    In the first query there is no need to join as the is already available in the bid table due to the FK relationship
    In the second query the Bid and Item table must be joined as the where condition contains "description" which is only available in the item table

    Hope this make things clear
    Follow the steps below

    1. Create the necessary hbm.xml file for your table Users, Lecturers and Professor.
    2. Ensure that in your table hbm.xml file there is <one-to-many> relationship to the Lecturer table.
    Similarly make sure there is one-to-one relationship between Lecturers and Professor

    3. Finally, all you need is a method called getUserDetails(). In there all you will need to do is query User


    4. In yous display screen you can get the lecturers details like users.getLecturers() and professor like users.getLecturers().getProfessor()

    Hope that this helps to lead you to the correct path
    Krishna, I think you did not read Mark's reply properly

    So for instance, I have a User object and a User has a List of Address objects, but Address is not mapped as an @Entity, but as an @Embeddable. With this in mind, there is no @OneToMany that you can use, you would need to use @CollectionOfElements instead

    So all this saying you will use @CollectionOfElements for cases where your collection is not an Entity, thus no question of @OneToMany or @ManyToOne
    I hope that you are not declaring your JSF Managed bean as a hbm.xml file. Faces-Config.xml is ony meant for JSF Managed Beans like Backing Bean etc. While your hbm.xml file is meant for your database tables and only those should be specified in your cfg.xml file
    Same here. By going for a general Collections you will lose some specific methods that a detailed implementation provides. So I also feel you should use Collection type that is most suitable for your requirement
    Make sure you have


    By the way next time you hit "Class Not Found" exception, always check this website

    I would suggest that you make the small project as a seperate jar and the add the jar as dependend for the bigger jar. No matter what you will need two hibernate.cfg.xml file as it is two different schema thus having their own username and password. By having different jar it will allow you to manage then two project sperately