User Profile

Collapse

Profile Sidebar

Collapse
CatchSandeepVaid
CatchSandeepVaid
Last Activity: May 9 '10, 07:40 AM
Joined: Apr 27 '09
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • HI,
    The problem is i want that certain conditions to be always applied for a particular one-to-one association. Filters are meant for this in hibernate but we cant apply filters to one-to-one associations in hibernate.

    I implemented this functionality myself and tried to contribute this to Hibernate @ Hibernate Jira site but i am not satisfied with their response.
    See this link :
    http://opensource.atlas...
    See more | Go to post

    Leave a comment:


  • Hibernate :One-to-one association must return null instead of proxy (or actual object

    I have posted this question in hibernate forums also.. As this forum is related to java, i am posting it here also ...

    In hibernate, presently one-to-one associations are fetched non-lazily...
    I know that this is done because, hibernate requires to fire 1 sql to find whether proxy can be created or not...
    and if it has to fire 1 sql, then why not to load one-to-one object itself in 1 sql instead of creating proxy of it...
    See more | Go to post

  • Hibenrtae :One-To-One Filter Applied, Non-Lazy Fetch Problem

    Suppose i have one-to-one association between Product and ProductBasic. and we have applied filter on ProductBasic Class.
    I have applied this filter as in Java side we have one-to-one relationship between Product and ProductBasic BUT at database side
    we have one-to-many relationship between PRODUCT and PRODUCTBASIC. and we apply a condition (STARTTIME < CURRETTIME < ENDTIME)
    while fetching PRODUCTBASIC, and this will always...
    See more | Go to post

  • Hibernate : one-to-one non-lazy loading but Filters Not Applied.

    We all know that one-to-one associations are non-lazly fetched but during this fetching the filters are not applied.
    I debugged hibernate code and found that hibernate finally calls EntityLoader.lo adByUniqueKey() method:
    [code=java]
    public Object loadByUniqueKey (SessionImpleme ntor session, Object key)
    throws HibernateExcept ion {
    return load(session, key, null, null);
    }
    [/code]
    I can understand...
    See more | Go to post
    Last edited by Nepomuk; May 27 '09, 08:22 PM. Reason: Please use [code] tags

  • This is a hibernate question only.. I want to know what to do in this situation...
    Can i post hibernate questions in bytes forum ?
    See more | Go to post

    Leave a comment:


  • CatchSandeepVaid
    started a topic Hibernate : <One-to-one> Filter Required
    in Java

    Hibernate : <One-to-one> Filter Required

    Consider this scenatio :
    I have one-to-one relation between Product and ProductBasic BUT at database level i have one-to-many between
    PRODUCT and PRODUCTBASIC tables as history is mainted in the same table :

    PRODUCT ----> PID (PK)
    PRODUCTBASIC ---> PID (FK), USECODE forms Composite-key

    PRODUCT
    PID PNAME
    1 Pen

    PRODUCTBASIC
    PID USECODE STARTTIME ENDTIME...
    See more | Go to post

  • Lets see whether others can help me on this. I have also posted this question in all hibernate forums...
    See more | Go to post

    Leave a comment:


  • This is a hibernate query...
    I am new to bytes.com... If this is not the correct forum to put hibernate questions, then please let me know where can i post hibernate questions in bytes forum ?
    See more | Go to post

    Leave a comment:


  • one-to-one with property-ref always non-lazy

    I have one-to-one relationship betnwee Product and ProductBasic.


    <one-to-one name="productBa sic" cascade="save-update" property-ref="activeProd uct" lazy="proxy">
    <formula>'1'</formula>
    <formula>PRODUC TID</formula>
    </one-to-one>


    ProductBasic.hb m.xml as :
    <properties name="activePro duct">...
    See more | Go to post

  • Actually i have written a generic method which accepts the association names and collection names and creates a inner join fetch between them at runtime (using filters also). and i just execute the dynamically generated HQL which returns me root domain object with it's few associations and collections collections populated (which i have asked for)...Now i don;t know which relationship name represented association and which represented collection.....
    See more | Go to post

    Leave a comment:


  • Actually the problem is not just simple,
    if we consider the entire tree graph(including associations and collections), removing null manulaly from all collections will be a tedious task
    See more | Go to post

    Leave a comment:


  • Filter on List - null elements - very interesting

    Say i have one-to-many relationship between Product and ProductNames. So Product has a List of ProductNames.


    Actually we are using List for productNames.an d for list, in order to maintain the sequence, it stores the sequence in
    extra seperate column in DB.
    Now say, after applying the filer conditions, 0th, 2nd and 5th element (out of 10 )of the list gets selected..
    Returned list size will of...
    See more | Go to post

  • Specifying the conditions for inner join at runtime using Filter

    Say i have one-to-many relationship between Product and ProductNames
    Product ----> PID (PK)
    ProductNames------> PID, USECODE, STARTTIME as composite ID and ENDTIME is another normal column.

    Now i want to fetch product with PID='1' and USECODE='100' and STARTTIME < CURRENTTIME < ENDTIME.

    CURRENTTIME value will be known at runtime.

    How to specify this in mapping and fetch...
    See more | Go to post

  • Specify relationship in mapping using some condition not just id's.

    Say i have one-to-one relationship
    Say i have one-to-many relationship between Product and ProductNames
    Product ----> PID (PK)
    ProductNames------> PID, USECODE, STARTTIME as composite ID and ENDTIME is another normal column.

    Now i want to fetch product with PID='1' and USECODE='100' and STARTTIME < CURRENTTIME < ENDTIME.

    CURRENTTIME value will be known at runtime.
    ...
    See more | Go to post

  • CatchSandeepVaid
    started a topic "Left join Fetch" "With Clause" Required
    in Java

    "Left join Fetch" "With Clause" Required

    Product and ProductBasic has one-to-one relationship
    Product ---> ProductID <<PK>>
    ProductBasic ----> ProductId, useCode, StartTime as composite key.....
    this startTime's value will be known as runtime.

    Now i want to define mapping between Product & ProductBasic, how will i do it ?



    Moreover suppose i define their mapping as product.product ID = productBasic.pr oductID...
    See more | Go to post
No activity results to display
Show More
Working...