History | Log In     View a printable version of the current page. Get help!  
Issue Details [XML]

Key: EJB-74
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Vance Karimi
Reporter: D. S.
Votes: (View)
Watchers: (View)
Operations

If you were logged in you would be able to see more operations.
EJB Cartridge

Embedded Value Objects can't be instanciated by hibernate

Created: 27/Jul/07 11:31 AM   Updated: 27/Jul/07 11:31 AM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Environment: Application Server: JBoss 4.2.0


 Description   
s. Forum http://galaxy.andromda.org/forum/viewtopic.php?t=4626&start=0&postdays=0&postorder=asc

I am using EJB3-Cartridge to generate data access layer for my application. The domain model contains the datatype money, which I want to generate as Embedded Value Object. Money datatype should have additionally some methods like add() and changeCurrency(). EJB3-Cartridge generate this classes:

Code:

public abstract class Money
    implements java.io.Serializable
{
    ...
}


Code:

public class MoneyImpl
    extends Money
{
    ...
}


The entities using the money datatype reference the abstract class money

Code:

public class Bill
    implements java.io.Serializable
{
   ...
    @javax.persistence.Embedded
    public Money getAmount()
    {
        return _amount;
    }
}


If I try to get the entity from the database the following error occurs:

javax.persistence.PersistenceException: org.hibernate.InstantiationException: Cannot instantiate abstract class or interface: Money

Is it possible to generate, like by entities, an embedded abstract class MoneyEmbedded and embeddable class Money, where the additionally methods should be implemented?

 All   Comments   Change History      Sort Order:
There are no comments yet on this issue.