[appengine-java] Re: Can't get JUnit to test making a JDO object persistent

2010-01-27 Thread Will Bunker
Also turned on logging of the  Datanucleus to the finest level and am
getting the following:


Jan 27, 2010 2:00:08 PM org.datanucleus.PersistenceConfiguration
setProperty
INFO: Property datanucleus.rdbms.sql.allowAllSQLStatements unknown -
will be ignored
Jan 27, 2010 2:00:08 PM org.datanucleus.PersistenceConfiguration
setProperty
INFO: Property datanucleus.rdbms.stringDefaultLength unknown - will be
ignored
Jan 27, 2010 2:00:08 PM org.datanucleus.PersistenceConfiguration
setProperty
INFO: Property datanucleus.appengine.autoCreateDatastoreTxns unknown -
will be ignored
Jan 27, 2010 2:00:08 PM org.datanucleus.ObjectManagerFactoryImpl
logConfiguration
INFO: = Persistence Configuration ===
Jan 27, 2010 2:00:08 PM org.datanucleus.ObjectManagerFactoryImpl
logConfiguration
INFO: DataNucleus Persistence Factory - Vendor: DataNucleus
Version: 1.1.5
Jan 27, 2010 2:00:08 PM org.datanucleus.ObjectManagerFactoryImpl
logConfiguration
INFO: DataNucleus Persistence Factory initialised for datastore
URL=appengine driver= userName=
Jan 27, 2010 2:00:08 PM org.datanucleus.ObjectManagerFactoryImpl
logConfiguration
INFO: ===
Jan 27, 2010 2:00:08 PM org.datanucleus.PersistenceConfiguration
setProperty
INFO: Property datanucleus.query.cached unknown - will be ignored
Jan 27, 2010 2:00:08 PM
org.datanucleus.jdo.metadata.JDOMetaDataManager init
INFO: Registering listener for metadata initialisation
Jan 27, 2010 2:00:08 PM org.datanucleus.jdo.metadata.JDOMetaDataManager
$MetaDataRegisterClassListener registerClass
INFO: Listener found initialisation for persistable class
com.sootra.shared.User
Jan 27, 2010 2:00:08 PM
org.datanucleus.jdo.metadata.JDOAnnotationReader
processClassAnnotations
INFO: Class com.sootra.shared.User has been specified with JDO
annotations so using those.
Jan 27, 2010 2:00:08 PM
org.datanucleus.store.appengine.MetaDataValidator validate
INFO: Performing appengine-specific metadata validation for
com.sootra.shared.User
Jan 27, 2010 2:00:08 PM
org.datanucleus.store.appengine.MetaDataValidator validate
INFO: Finished performing appengine-specific metadata validation for
com.sootra.shared.User
Jan 27, 2010 2:00:08 PM org.datanucleus.store.StoreDataManager
registerStoreData
INFO: Managing Persistence of Class : com.sootra.shared.User [Table :
(none), InheritanceStrategy : subclass-table]
Jan 27, 2010 2:00:08 PM org.datanucleus.store.StoreDataManager
registerStoreData
INFO: Managing Persistence of Class : com.sootra.shared.User [Table :
(none), InheritanceStrategy : subclass-table]

So it seems to be running the metadata validation but then can't find
the enhanced information???

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Can't get JUnit to test making a JDO object persistent

2010-01-27 Thread Will Bunker
Here they are:


/**
 * Convenience method: gets a new PersistenceManager
 */
public PersistenceManager newPersistenceManager() {
  return this.getPersistenceManagerFactory()
  .getPersistenceManager();
}

/**
 * Gets the PersistenceManagerFactory that was created by
 * this Initializer.
 */
public PersistenceManagerFactory getPersistenceManagerFactory() {
  if (pmf == null) {

Logger.getLogger(DataNucleus.JDO).setLevel(Level.FINEST);
Logger.getLogger(DataNucleus.JPA).setLevel(Level.FINEST);
Logger.getLogger(DataNucleus.Persistence).setLevel
(Level.FINEST);
Logger.getLogger(DataNucleus.Query).setLevel(Level.FINEST);
Logger.getLogger(DataNucleus.Lifecycle).setLevel(Level.FINEST);
Logger.getLogger(DataNucleus.Reachability).setLevel
(Level.FINEST);
Logger.getLogger(DataNucleus.Cache).setLevel(Level.FINEST);
Logger.getLogger(DataNucleus.ClassLoading).setLevel
(Level.FINEST);
Logger.getLogger(DataNucleus.MetaData).setLevel
(Level.FINEST);
Logger.getLogger(DataNucleus.Management).setLevel
(Level.FINEST);
Logger.getLogger(DataNucleus.General).setLevel
(Level.FINEST);
Logger.getLogger(DataNucleus.Connection).setLevel
(Level.FINEST);
Logger.getLogger(DataNucleus.JCA).setLevel(Level.FINEST);
Logger.getLogger(DataNucleus.Transaction).setLevel
(Level.FINEST);
Logger.getLogger(DataNucleus.Plugin).setLevel(Level.OFF);
Logger.getLogger(DataNucleus.ValueGeneration).setLevel
(Level.FINEST);
Logger.getLogger(DataNucleus.Datastore).setLevel
(Level.FINEST);
Logger.getLogger(DataNucleus.Datastore.Schema).setLevel
(Level.FINEST);
Logger.getLogger(DataNucleus.Datastore.Persist).setLevel
(Level.FINEST);
Logger.getLogger(DataNucleus.Datastore.Retrieve).setLevel
(Level.FINEST);
Logger.getLogger(DataNucleus.Datastore.Native).setLevel
(Level.FINEST);
Logger.getLogger(DataNucleus.Enhancer).setLevel
(Level.FINEST);
Logger.getLogger(DataNucleus.SchemaTool).setLevel
(Level.FINEST);
Logger.getLogger(DataNucleus.IDE).setLevel(Level.FINEST);


Properties newProperties = new Properties();
newProperties.put(javax.jdo.PersistenceManagerFactoryClass,
 
org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManagerFactory);
newProperties.put
(javax.jdo.option.ConnectionURL,appengine);
newProperties.put(javax.jdo.option.NontransactionalRead,
true);
newProperties.put(javax.jdo.option.NontransactionalWrite,
true);
newProperties.put(javax.jdo.option.RetainValues,true);
newProperties.put
(datanucleus.appengine.autoCreateDatastoreTxns,true);
pmf = JDOHelper.getPersistenceManagerFactory(newProperties);
  }
  return pmf;
}


@PersistenceCapable(identityType = IdentityType.APPLICATION)
@Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE)
public class User implements PersistHooks {

@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;

@Persistent
private Email email;

@Persistent
private String user_type;


@Persistent
private String password;

@Persistent
private Date create_time;

@Persistent
private Date create_date;

@Persistent
private Date update_time;

@Persistent
private Date update_date;

@SuppressWarnings(deprecation)
public void beforeSave() {
if (this.create_date == null) {
this.create_time = new Date();
this.create_date = new Date(create_time.getYear(),
create_time.getMonth(), create_time.getDate());
}
this.update_time = new Date();
this.update_date = new Date(update_time.getYear(),
update_time.getMonth(), update_time.getDate());
}

public void afterLoad() {}

public User(String email, String password) {
this.email = new Email(email);
this.password = password;
}

public User() {

}

public Key getKey() {
return key;
}

public void setKey(Key key) {
this.key = key;
}

public Email getEmail() {
return email;
}

public void setEmail(Email email) {
this.email = email;
}

public String getPassword() {
return password;
}

public void setPassword(String password) {
this.password = password;
}

public Date getCreate_time() {
return create_time;
}

public void setCreate_time(Date createTime) {
create_time = createTime;
}

public Date getCreate_date() {
return create_date;
}

public 

[appengine-java] Re: Can't get JUnit to test making a JDO object persistent

2010-01-27 Thread Will Bunker
I was wrong with my initial analysis.  I had assumed because a
subclass was persisting that the super class would also.  When I try
and add a User I get the meta/data missing also in local environment.

I have narrowed it down to one line which triggers the problem:

@Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE)
public class User implements PersistHooks {


when I take out the @Inheritance then it finds the meta-data for the
user class.  Is this a feature or a bug??

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Can't get JUnit to test making a JDO object persistent

2010-01-27 Thread Will Bunker
Realize that I totally misunderstood the @inheritance properties.  I
was assuming that all subclasses would be store in super class, but
realize that it is the opposite.  So there is no actual meta data
being generated for the user table, but all the fields are put in the
metadata for subclass.

On Jan 27, 3:40 pm, Will Bunker w...@thebunkers.com wrote:
 I was wrong with my initial analysis.  I had assumed because a
 subclass was persisting that the super class would also.  When I try
 and add a User I get the meta/data missing also in local environment.

 I have narrowed it down to one line which triggers the problem:

 @Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE)
 public class User implements PersistHooks {

 when I take out the @Inheritance then it finds the meta-data for the
 user class.  Is this a feature or a bug??

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] Re: Can't get JUnit to test making a JDO object persistent

2010-01-27 Thread Ikai L (Google)
I'm not entirely sure what you're doing with inheritance, but does this open
issue help?

http://code.google.com/p/datanucleus-appengine/issues/detail?id=25

On Wed, Jan 27, 2010 at 5:08 PM, Will Bunker w...@thebunkers.com wrote:

 Realize that I totally misunderstood the @inheritance properties.  I
 was assuming that all subclasses would be store in super class, but
 realize that it is the opposite.  So there is no actual meta data
 being generated for the user table, but all the fields are put in the
 metadata for subclass.

 On Jan 27, 3:40 pm, Will Bunker w...@thebunkers.com wrote:
  I was wrong with my initial analysis.  I had assumed because a
  subclass was persisting that the super class would also.  When I try
  and add a User I get the meta/data missing also in local environment.
 
  I have narrowed it down to one line which triggers the problem:
 
  @Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE)
  public class User implements PersistHooks {
 
  when I take out the @Inheritance then it finds the meta-data for the
  user class.  Is this a feature or a bug??

 --
 You received this message because you are subscribed to the Google Groups
 Google App Engine for Java group.
 To post to this group, send email to
 google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.




-- 
Ikai Lan
Developer Programs Engineer, Google App Engine
http://googleappengine.blogspot.com | http://twitter.com/app_engine

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.