[google-appengine] Inheritance newbie question

2010-10-18 Thread Eyal
Hi all,

I'm new to this and trying to make inheritance work. Looking at the
documentation (http://code.google.com/appengine/docs/java/datastore/
dataclasses.html#Inheritance) I see that I can not use new-table for
an object that is not at the root of the inheritance hierarchy. So I'm
trying this: @Inheritance(strategy =
InheritanceStrategy.NEW_TABLE) on User, an object that is at the
root of the hierarchy, and I'm leaving the object extending it,
Publisher without an inheritance strategy.

I'm getting the following:
org.datanucleus.store.appengine.DatastoreManager
$UnsupportedInheritanceStrategyException: Found inheritance strategy
'superclass-table' on com.myapp.model.Publisher.

Like I said, there is no inheritance strategy on Publisher, so I
assume the framework is adding the superclass-table on its own.

What should I do? How should go about it? The documentation gives an
example for and abstract class at the root, but for my app I need User
to be stored in it's own table, and only some Users are Publishers, so
there would also be a Publisher table.

I'll greatly appreciate your help.

Thanks,
Eyal

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



[google-appengine] Inheritance question

2010-10-18 Thread Eyal
Hi all,

I'm new to this and trying to make inheritance work. Looking at the
documentation (http://code.google.com/appengine/docs/java/datastore/
dataclasses.html#Inheritance) I see that I can not use new-table for
an object that is not at the root of the inheritance hierarchy. Fine.
I'm trying this: @Inheritance(strategy =
InheritanceStrategy.NEW_TABLE) on User, an object that IS AT THE
ROOT of the hierarchy, and I'm leaving the object extending it,
Publisher without an inheritance strategy.

I'm getting the following:
org.datanucleus.store.appengine.DatastoreManager
$UnsupportedInheritanceStrategyException: Found inheritance strategy
'superclass-table' on com.myapp.model.Publisher.

Like I said, there is no inheritance strategy on Publisher, so I
assume the framework is adding the superclass-table on its own.

What should I do? How should go about it? The documentation gives an
example for and abstract class at the root, but for my app I need User
to be stored in it's own table, and only some Users are Publishers, so
there would also be a Publisher table.

I'll greatly appreciate your help.

Thanks,
Eyal

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



[google-appengine] Inheritance

2010-09-06 Thread lisandro
Hi ! I have a problem with inheritance, at persist in the datastore.

When persist a child class, the
error is:
We have not found the Meta-Data/annotations for the class
model.RegFechaUsuario.
Please verify that it has put it in a file correct and valid XML

The configuration in the link :
http://code.google.com/intl/es/appengine/docs/java/datastore/relation...,
does not say anything on inheritance.
Since the xmls would be formed?
Could someone make persist classes that use inheritance?

The code:

The parent class:

public  class Fecha implements Serializable {

@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key id;
@Persistent
private String nombre;
@Persistent
private Date fechaIni;
@Persistent
private Date fechaFin;

@Persistent(defaultFetchGroup = true)
ListPartido partidos;

private Long id2;

private Long kind;

public Fecha(String nombre, Date fechaIni, Date fechaFin) {
//super();
this.nombre = nombre;
this.fechaIni = fechaIni;
this.fechaFin = fechaFin;
this.setPartidos(new ArrayListPartido());
}
---
The child class:

@PersistenceCapable(identityType =
IdentityType.APPLICATION,detachable=true)
@Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE)
public class RegFechaUsuario extends Fecha implements Serializable {

@Persistent
private int puntos;
@Persistent
private Long idUsuarioFecha;
@Persistent
private Long idFechaOriginal;


The register of the class RegFechaUsuario:

public RegFechaUsuario crearFechaParaRegistro(Long idUsuario, Fecha
fechaOriginal,Fecha nuevaFecha) {

ControladorTorneo cGT = new ControladorTorneo();
RegFechaUsuario regFechaUsuario = new
RegFechaUsuario(0,
idUsuario,
fechaOriginal.getId2(),nuevaFecha);

cGT.crearRegFechaUsuario(regFechaUsuario);
return regFechaUsuario;

}

The builder of the child class:
public RegFechaUsuario(int puntos, Long idUsuarioFecha,
Long idFechaOriginal, Fecha fechaRegUsuario) {
super(fechaRegUsuario.getNombre(),
fechaRegUsuario.getFechaIni(),
fechaRegUsuario.getFechaFin());
this.setPuntos(puntos);
this.setIdUsuarioFecha(idUsuarioFecha);
this.setIdFechaOriginal(idFechaOriginal);

}

Save the register in the datastore:

public void crearRegFechaUsuario(RegFechaUsuario regFechaUsuario) {

Transaction tx = pm.currentTransaction();
try {
tx.begin();

pm.makePersistentAll(regFechaUsuario);
//Here is the exception, in makePersistent
tx.commit();
} finally {
// pm.close();
if (tx.isActive()) {
tx.rollback();
}
}

}

Regards
Lisandro

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



Re: [google-appengine] Inheritance

2010-09-05 Thread Ehsan- ul-haq
hi you may upload your videos on http://pmedia4u.com its free and provide
you a 1GB limits

On Sat, Sep 4, 2010 at 9:06 PM, lisandro lisandr...@gmail.com wrote:

 Hi!
 Someone has some code working correctly that uses inheritance?
 Example?
 Since
 in the link:

 http://code.google.com/intl/es/appengine/docs/java/datastore/relation...
 He does not say anything in the matter...

 Regards
 Lisandro

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



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



Re: [google-appengine] Inheritance

2010-09-05 Thread Jeff Schwartz
He dick head, enough already. Somebody please filter this jerk off the list
please.

On Sun, Sep 5, 2010 at 10:52 PM, Ehsan- ul-haq iehsa...@gmail.com wrote:

 hi you may upload your videos on http://pmedia4u.com its free and provide
 you a 1GB limits

 On Sat, Sep 4, 2010 at 9:06 PM, lisandro lisandr...@gmail.com wrote:

 Hi!
 Someone has some code working correctly that uses inheritance?
 Example?
 Since
 in the link:

 http://code.google.com/intl/es/appengine/docs/java/datastore/relation...
 He does not say anything in the matter...

 Regards
 Lisandro

 --

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


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




-- 
--
Jeff

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



[google-appengine] Inheritance

2010-09-04 Thread lisandro
Hi!
Someone has some code working correctly that uses inheritance?
Example?
Since
in the link:

http://code.google.com/intl/es/appengine/docs/java/datastore/relation...
He does not say anything in the matter...

Regards
Lisandro

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



Re: [google-appengine] Inheritance

2010-09-04 Thread Robert Kluin
What do you mean inheritance?  Your link is broke.



Robert





On Sat, Sep 4, 2010 at 12:06, lisandro lisandr...@gmail.com wrote:
 Hi!
 Someone has some code working correctly that uses inheritance?
 Example?
 Since
 in the link:

 http://code.google.com/intl/es/appengine/docs/java/datastore/relation...
 He does not say anything in the matter...

 Regards
 Lisandro

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



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