Marina,
Marina Vatkina wrote:
>----- Original Message -----
>From: Sanjeeb Kumar Sahoo <Sanjeeb.Sahoo_at_Sun.COM>
>Date: Thursday, January 12, 2006 9:57 am
>Subject: Re: no.weaving option
>
>
>
>>Pierre Delisle wrote:
>>
>>
>>
>>>Mitesh,
>>>
>>>
>>>
>>>
>>>
>>>>Please pass a HashMap to createEntityManagerFactory as follows
>>>>
>>>>
>>to work
>>
>>
>>>>around the NPE.
>>>> EntityManagerFactory emf =
>>>>Persistence.createEntityManagerFactory("em", new HashMap());
>>>>
>>>>
>>>>
>>>>
>>>This did the trick. Many thanks for the quick reply!
>>>Please let me know if I should file a bug.
>>>
>>>
>>>
>>>
>>>
>>There are two issues here:
>>1) The sample code in our website should be fixed b'cos it uses a
>>non-standard method. Spec does not mention about
>>createEntityManagerfactory(String).
>>
>>
>
>This is standard - the 1st version version of the
>API below takes a String.
>
>
>
You are right. Not sure what I was reading. It's time I went to sleep.
Thanks,
Sahoo
>-marina
>
>
>>2) Secondly, the javadocs (see below) do not say that properties
>>argument can't be null. So TopLink should not throw NPE.
>>Pl. file a bug for this.
>>
>>Thanks,
>>Sahoo
>>
>>PFD version of javax.persistence.Persistence.class:
>>
>>/**
>>* Bootstrap class that is used to obtain an
>>* EntityManagerFactory, from which EntityManager
>>* references can be obtained.
>>*/
>>public class Persistence {
>>/**
>>* Create and return an EntityManagerFactory for the
>>* named persistence unit.
>>*
>>* @param persistenceUnitName The name of the persistence unit
>>* @return The factory that creates EntityManagers configured
>>* according to the specified persistence unit
>>*/
>>public static EntityManagerFactory createEntityManagerFactory(
>>String persistenceUnitName) {...}
>>/**
>>* Create and return an EntityManagerFactory for the
>>* named persistence unit using the given properties.
>>*
>>* @param persistenceUnitName The name of the persistence unit
>>* @param props Additional properties to use when creating the
>>* factory. The values of these properties override any values
>>* that may have been configured elsewhere.
>>* @return The factory that creates EntityManagers configured
>>* according to the specified persistence unit.
>>*/
>>public static EntityManagerFactory createEntityManagerFactory(
>>String persistenceUnitName, Map properties) {...}
>>...
>>}
>>
>>
>>
>>> -- Pierre
>>>
>>>
>>>
>>>