<?xml version="1.0" encoding="UTF-8"?>











<rss version="2.0" xmlns:jf="http://www.jivesoftware.com/xmlns/jiveforums/rss">



<channel>
    <title>Support Forums: Message List - Entity EJB and primary key in DTO</title>
    <link>http://www.theserverside.com</link>
    <description>Most recent forum messages</description>
    <language>en</language>
    
        <generator>Jive Forums Silver 5.5.30 (www.jivesoftware.com)</generator>
    
    <pubDate>Sat, 18 May 2013 13:11:14 -0400</pubDate>


    <item>

        <title>Entity EJB and primary key in DTO</title>
        <link>http://www.theserverside.com/discussions/thread.tss?thread_id=32896</link>

        

        
            <description><![CDATA[I think you're suffering the good old &quot;model impedance&quot; syndromme... ;)<br>In order your DB constraint to work, the UPDATE should be performed when you entity.setName(&quot;THIS ONE IS DUPLICATED&quot;).<br>If this happened, performance would...]]></description>
        

        <pubDate>Fri, 01 Apr 2005 08:23:30 -0500</pubDate>

        

        <jf:creationDate>Fri, 01 Apr 2005 08:23:30 -0500</jf:creationDate>
        <jf:modificationDate>Fri, 01 Apr 2005 08:23:30 -0500</jf:modificationDate>
        <jf:date>Apr 1, 2005</jf:date>
        <jf:author>Martin Straus</jf:author>
        <jf:replyCount>0</jf:replyCount>
    </item>


    <item>

        <title>Entity EJB and primary key in DTO</title>
        <link>http://www.theserverside.com/discussions/thread.tss?thread_id=32896</link>

        

        
            <description><![CDATA[Thanks, Martin, you're right, I've checked it and I shuoldn't call ejbStore directly. <br>My bean is CMP, so there is no code written by me which inserts or updates the table, the container generates it. The create method only sets the fields, and...]]></description>
        

        <pubDate>Thu, 31 Mar 2005 11:29:15 -0500</pubDate>

        

        <jf:creationDate>Thu, 31 Mar 2005 11:29:15 -0500</jf:creationDate>
        <jf:modificationDate>Thu, 31 Mar 2005 11:29:15 -0500</jf:modificationDate>
        <jf:date>Mar 31, 2005</jf:date>
        <jf:author>Ivan Nemeth</jf:author>
        <jf:replyCount>1</jf:replyCount>
    </item>


    <item>

        <title>Entity EJB and primary key in DTO</title>
        <link>http://www.theserverside.com/discussions/thread.tss?thread_id=32896</link>

        

        
            <description><![CDATA[It is <i>NOT</i> safe, in fact! You should <i>not</i> call lifecicle methods by yourself. They're meant to be called by the lifecicle manager... that is the container.<br>What method in the EJB performs the INSERT in the DB? Please check this is done...]]></description>
        

        <pubDate>Thu, 31 Mar 2005 07:58:51 -0500</pubDate>

        

        <jf:creationDate>Thu, 31 Mar 2005 07:58:51 -0500</jf:creationDate>
        <jf:modificationDate>Thu, 31 Mar 2005 07:58:51 -0500</jf:modificationDate>
        <jf:date>Mar 31, 2005</jf:date>
        <jf:author>Martin Straus</jf:author>
        <jf:replyCount>2</jf:replyCount>
    </item>


    <item>

        <title>Entity EJB and primary key in DTO</title>
        <link>http://www.theserverside.com/discussions/thread.tss?thread_id=32896</link>

        

        
            <description><![CDATA[It's me again. :)<br>Finally I've found a solution, I simply call ejbStore from the bean's ejbPostCreate method and it immediately throws an exception which I can catch. What do you think about this? It seems to me safe.<br><br>Ivan]]></description>
        

        <pubDate>Wed, 30 Mar 2005 16:33:00 -0500</pubDate>

        

        <jf:creationDate>Wed, 30 Mar 2005 16:33:00 -0500</jf:creationDate>
        <jf:modificationDate>Wed, 30 Mar 2005 16:33:00 -0500</jf:modificationDate>
        <jf:date>Mar 30, 2005</jf:date>
        <jf:author>Ivan Nemeth</jf:author>
        <jf:replyCount>3</jf:replyCount>
    </item>


    <item>

        <title>Entity EJB and primary key in DTO</title>
        <link>http://www.theserverside.com/discussions/thread.tss?thread_id=32896</link>

        

        
            <description><![CDATA[Of course there was exception handling in the second catch, but I was lazy to write it in the reply.<br>Ivan]]></description>
        

        <pubDate>Wed, 30 Mar 2005 16:21:04 -0500</pubDate>

        

        <jf:creationDate>Wed, 30 Mar 2005 16:21:04 -0500</jf:creationDate>
        <jf:modificationDate>Wed, 30 Mar 2005 16:21:04 -0500</jf:modificationDate>
        <jf:date>Mar 30, 2005</jf:date>
        <jf:author>Ivan Nemeth</jf:author>
        <jf:replyCount>4</jf:replyCount>
    </item>


    <item>

        <title>Entity EJB and primary key in DTO</title>
        <link>http://www.theserverside.com/discussions/thread.tss?thread_id=32896</link>

        

        
            <description><![CDATA[I CAN'T! REALLY! :)<br>I have a facade which creates a new bean but with an already existing Name (Name must be unique). In the facade's newBean method (which is called by the client) I call the home interface's create() method. It looked something like...]]></description>
        

        <pubDate>Wed, 30 Mar 2005 15:59:05 -0500</pubDate>

        

        <jf:creationDate>Wed, 30 Mar 2005 15:59:05 -0500</jf:creationDate>
        <jf:modificationDate>Wed, 30 Mar 2005 15:59:05 -0500</jf:modificationDate>
        <jf:date>Mar 30, 2005</jf:date>
        <jf:author>Ivan Nemeth</jf:author>
        <jf:replyCount>5</jf:replyCount>
    </item>


    <item>

        <title>Entity EJB and primary key in DTO</title>
        <link>http://www.theserverside.com/discussions/thread.tss?thread_id=32896</link>

        

        
            <description><![CDATA[What do you mean you can't catch the exception? Who calls the YourEjbHome.create() method?<br>If you have a facade, feel free to do it. Wrap the SQLException within some other application relative exception, so the client catches this rather than...]]></description>
        

        <pubDate>Wed, 30 Mar 2005 13:11:24 -0500</pubDate>

        

        <jf:creationDate>Wed, 30 Mar 2005 13:11:24 -0500</jf:creationDate>
        <jf:modificationDate>Wed, 30 Mar 2005 13:11:24 -0500</jf:modificationDate>
        <jf:date>Mar 30, 2005</jf:date>
        <jf:author>Martin Straus</jf:author>
        <jf:replyCount>6</jf:replyCount>
    </item>


    <item>

        <title>Entity EJB and primary key in DTO</title>
        <link>http://www.theserverside.com/discussions/thread.tss?thread_id=32896</link>

        

        
            <description><![CDATA[Thanks for help, it seems a good solution (private access was a wrong idea, as you pointed it out).<br>I've another problem. So if I use an id as a primary key, but I have a field (for example NAME) which I want to be unique, how can I manage it?<br>I...]]></description>
        

        <pubDate>Tue, 29 Mar 2005 14:17:10 -0500</pubDate>

        

        <jf:creationDate>Tue, 29 Mar 2005 14:17:10 -0500</jf:creationDate>
        <jf:modificationDate>Tue, 29 Mar 2005 14:17:10 -0500</jf:modificationDate>
        <jf:date>Mar 29, 2005</jf:date>
        <jf:author>Ivan Nemeth</jf:author>
        <jf:replyCount>7</jf:replyCount>
    </item>


    <item>

        <title>Entity EJB and primary key in DTO</title>
        <link>http://www.theserverside.com/discussions/thread.tss?thread_id=32896</link>

        

        
            <description><![CDATA[<blockquote>Hi all,if I use an entity bean I can't change value of the primary key field... My first question is that is this right what I wrote.</blockquote><br>This is my understanding. When learning EJBs, I attempted to create an EJB with a mutable...]]></description>
        

        <pubDate>Mon, 28 Mar 2005 15:34:28 -0500</pubDate>

        

        <jf:creationDate>Mon, 28 Mar 2005 15:34:28 -0500</jf:creationDate>
        <jf:modificationDate>Mon, 28 Mar 2005 15:34:28 -0500</jf:modificationDate>
        <jf:date>Mar 28, 2005</jf:date>
        <jf:author>Aaron Craven</jf:author>
        <jf:replyCount>8</jf:replyCount>
    </item>


    <item>

        <title>Entity EJB and primary key in DTO</title>
        <link>http://www.theserverside.com/discussions/thread.tss?thread_id=32896</link>

        

        
            <description><![CDATA[Hi all,<br><br>if I use an entity bean I can't change value of the primary key field. I suppose it's the desired behaviour of EJBs. So I think it's not a good design to use the name field of the modelled object as a primary key because it can change...]]></description>
        

        <pubDate>Mon, 28 Mar 2005 14:44:39 -0500</pubDate>

        

        <jf:creationDate>Mon, 28 Mar 2005 14:44:39 -0500</jf:creationDate>
        <jf:modificationDate>Mon, 28 Mar 2005 14:44:39 -0500</jf:modificationDate>
        <jf:date>Mar 28, 2005</jf:date>
        <jf:author>Ivan Nemeth</jf:author>
        <jf:replyCount>9</jf:replyCount>
    </item>



</channel>
</rss>

