Here's the code from that class for your convenience:
package org.appfuse.dao.jpa;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import javax.persistence.EmbeddedId;
import javax.persistence.Id;
import javax.persistence.PersistenceException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class DaoUtils {
protected static final Log log = LogFactory.getLog(DaoUtils.class);
public static Object getPersistentId(Object o) throws PersistenceException {
Object objId = null;
Method [] methods = o.getClass().getDeclaredMethods();
final String eMsg = "Error executing get<IdValue> method on
persistent class.";
try {
String logMsg = "Persistent identity for object of type
'?1' is of type '?2' and is accessible with method '?3'";
for (Method aMethod : methods) {
Id idAnnotation = aMethod.getAnnotation(Id.class);
if (idAnnotation != null) {
objId = aMethod.invoke(o, null);
if (log.isDebugEnabled()) {
logMsg = logMsg.replace("?1", o.getClass().getName());
logMsg = logMsg.replace("?2", Id.class.toString());
logMsg = logMsg.replace("?3", aMethod.getName());
log.debug(logMsg);
}
break;
} else {
EmbeddedId eidAnnotation =
aMethod.getAnnotation(EmbeddedId.class);
if (eidAnnotation != null) {
objId = aMethod.invoke(o, null);
if (log.isDebugEnabled()) {
logMsg = logMsg.replace("?1",
o.getClass().toString());
logMsg = logMsg.replace("?2",
EmbeddedId.class.toString());
logMsg = logMsg.replace("?3", aMethod.toString());
log.debug(logMsg);
}
break;
}
}
}
} catch (IllegalArgumentException e) {
throw new PersistenceException(eMsg, e);
} catch (IllegalAccessException e) {
throw new PersistenceException(eMsg, e);
} catch (InvocationTargetException e) {
throw new PersistenceException(eMsg, e);
}
return objId;
}
}
Matt
On 12/21/06, André Faria <[EMAIL PROTECTED]> wrote:
I have attached the screen cap....
Thank's
Matt Raible escreveu:
It works for me at the following URL:
http://tinyurl.com/y63k6w
Matt
On 12/21/06, André Faria <[EMAIL PROTECTED]> wrote:
I was browsing in FishEye with Firefox 2... No SVN Clients...
Matt Raible escreveu:
> I've seen this with some SVN clients - which one are you using?
>
> Matt
>
> On 12/21/06, André Faria <[EMAIL PROTECTED]> wrote:
>>
>> I cant see the DaoUtil class in FishEye:
>>
>> SVN Client exception fetching content: svn: PROPFIND request failed on
>>
'/svn/appfuse/sandbox/jpa-hibernate-module/data/jpa-hibernate/src/main/java/org/appfuse/dao/jpa/DaoUtils.java'
>>
>> svn: can not read HTTP status line
>>
>>
http://fisheye4.cenqua.com/browse/appfuse/sandbox/jpa-hibernate-module/data/jpa-hibernate/src/main/java/org/appfuse/dao/jpa/DaoUtils.java
>>
>>
---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> [EMAIL PROTECTED] For additional
>> commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Atenciosamente,
André Faria
BlueSoft Consultoria em Informática
Fone: [55 11] 5543-5406
Web: www.bluesoft.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]
--
http://raibledesigns.com