Re: Enhancement skipping field
Sorry about taking so long to get back with you about this one. The initial email indicated that you guys were seeing a WARN message on enhancement[1], but does everything seem to be working properly? ie: Using the custom strategy to persist your field? Thanks, Rick [1] 411 openjpa WARN [main] openjpa.MetaData - Field com.spidertracks.aviator.model.user.Phone.idhttp://com.spidertracks.aviator.model.user.phone.id/ is not a type that is persistent by default. If you want this field to be persistent, you have to explicitly set it to persistent in your metadata. On Wed, Jul 13, 2011 at 2:55 PM, Matthew Goodson matt...@spidertracks.co.nz wrote: Oh sorry thats a typo I meant line 1864 in your class org.apache.openjpa.meta.ClassMetaData On Thu, Jul 14, 2011 at 2:01 AM, Rick Curtis curti...@gmail.com wrote: Todd - This happens on line 164 of the ClassMetaData class in the resolveMeta method and I get the following warning. I seem to remember for the Cassandra plugin that you implemented (or extended) the MetaDataRepository. Line 164 doesn't match with any code that I have. Can you try to test this out without the Metamodel and see if you can come up with a unit test? My tests seem to work fine. On Tue, Jul 12, 2011 at 10:23 PM, Matthew Goodson matt...@spidertracks.co.nz wrote: Hi, we are getting closer! We added a strategy the uuid field @Persistent @Strategy(com.datastax.hectorjpa.strategy.NoOpHandler) private UUID id; So now it successfully enhances the class which now looks like this @javax.persistence.metamodel.StaticMetamodel (value=com.spidertracks.aviator.model.user.Phone.class) @javax.annotation.Generated (value=org.apache.openjpa.persistence.meta.AnnotationProcessor6,date=Wed Jul 13 13:00:16 NZST 2011) public class Phone_ { public static volatile SingularAttributePhone,String countryIdd; public static volatile SingularAttributePhone,UUID id; public static volatile SingularAttributePhone,String iddCountryCode; public static volatile SingularAttributePhone,String number; public static volatile SingularAttributePhone,PhoneType type; } But when we go to load something it gets the list of fields, which includes the id field, but this field is then stripped out when he meta data is resolved. This happens on line 164 of the ClassMetaData class in the resolveMeta method and I get the following warning. 2011-07-13 03:16:23,295Z WARN [main] Field com.spidertracks.aviator.model.user.Phone.id is not a type that is persistent by default. If you want this field to be persistent, you have to explicitly set it to persistent in your metadata. Thanks On Wed, Jul 13, 2011 at 9:25 AM, Rick Curtis curti...@gmail.com wrote: Todd - I'm stretching a bit here as I've never actually experimented with this code but I'd start out by looking at org.apache.openjpa.persistence.jdbc.annotations.NonstandardMappingEntity and org.apache.openjpa.persistence.jdbc.annotations.TestNonstandardMappingAnnotations. It appears that you could add a @Strategy annotation to your UUID field and point it at your handler. That *should* auto-magically wire up the proper calls to you handler. If/when you get that working, it looks like you should be able to add this strategy(UUID-customer handler) to the mapping defaults. On Tue, Jul 12, 2011 at 3:58 PM, Todd Nine t...@spidertracks.com wrote: Hey Rick, Adding the handler makes the field appear in the field list for my plugin. However my plugin currently doesn't support value handlers. I need to add this functionality, what is the best class to use as an example for reading this meta data and invoking it at runtime? Thanks, Todd On Tue, 2011-07-12 at 11:18 -0500, Rick Curtis wrote: Todd - I don't think the problem is that the enhancer skips the field, its the fact that we don't know how the map the UUID field. You might be able to write a customer value handler [1] ? Take a look at that and see if it would work for you. Let me know how it goes. [1] http://openjpa.apache.org/builds/latest/docs/manual/manual.html#ref_guide_mapping_custom_vhandler On Sun, Jul 10, 2011 at 3:12 PM, Todd Nine t...@spidertracks.com wrote: Hey guys, I'm also involved in this project, I'm the developer for this plugin. https://github.com/riptano/hector-jpa/ The UUID class is used extensively by quite a few Cassandra developers. We've successfully used it as an identity, and my plug in recognizes the data type and can correctly serialize it. However, when not used in either a
Re: Enhancement skipping field
Oh sorry thats a typo I meant line 1864 in your class org.apache.openjpa.meta.ClassMetaData On Thu, Jul 14, 2011 at 2:01 AM, Rick Curtis curti...@gmail.com wrote: Todd - This happens on line 164 of the ClassMetaData class in the resolveMeta method and I get the following warning. I seem to remember for the Cassandra plugin that you implemented (or extended) the MetaDataRepository. Line 164 doesn't match with any code that I have. Can you try to test this out without the Metamodel and see if you can come up with a unit test? My tests seem to work fine. On Tue, Jul 12, 2011 at 10:23 PM, Matthew Goodson matt...@spidertracks.co.nz wrote: Hi, we are getting closer! We added a strategy the uuid field @Persistent @Strategy(com.datastax.hectorjpa.strategy.NoOpHandler) private UUID id; So now it successfully enhances the class which now looks like this @javax.persistence.metamodel.StaticMetamodel (value=com.spidertracks.aviator.model.user.Phone.class) @javax.annotation.Generated (value=org.apache.openjpa.persistence.meta.AnnotationProcessor6,date=Wed Jul 13 13:00:16 NZST 2011) public class Phone_ { public static volatile SingularAttributePhone,String countryIdd; public static volatile SingularAttributePhone,UUID id; public static volatile SingularAttributePhone,String iddCountryCode; public static volatile SingularAttributePhone,String number; public static volatile SingularAttributePhone,PhoneType type; } But when we go to load something it gets the list of fields, which includes the id field, but this field is then stripped out when he meta data is resolved. This happens on line 164 of the ClassMetaData class in the resolveMeta method and I get the following warning. 2011-07-13 03:16:23,295Z WARN [main] Field com.spidertracks.aviator.model.user.Phone.id is not a type that is persistent by default. If you want this field to be persistent, you have to explicitly set it to persistent in your metadata. Thanks On Wed, Jul 13, 2011 at 9:25 AM, Rick Curtis curti...@gmail.com wrote: Todd - I'm stretching a bit here as I've never actually experimented with this code but I'd start out by looking at org.apache.openjpa.persistence.jdbc.annotations.NonstandardMappingEntity and org.apache.openjpa.persistence.jdbc.annotations.TestNonstandardMappingAnnotations. It appears that you could add a @Strategy annotation to your UUID field and point it at your handler. That *should* auto-magically wire up the proper calls to you handler. If/when you get that working, it looks like you should be able to add this strategy(UUID-customer handler) to the mapping defaults. On Tue, Jul 12, 2011 at 3:58 PM, Todd Nine t...@spidertracks.com wrote: Hey Rick, Adding the handler makes the field appear in the field list for my plugin. However my plugin currently doesn't support value handlers. I need to add this functionality, what is the best class to use as an example for reading this meta data and invoking it at runtime? Thanks, Todd On Tue, 2011-07-12 at 11:18 -0500, Rick Curtis wrote: Todd - I don't think the problem is that the enhancer skips the field, its the fact that we don't know how the map the UUID field. You might be able to write a customer value handler [1] ? Take a look at that and see if it would work for you. Let me know how it goes. [1] http://openjpa.apache.org/builds/latest/docs/manual/manual.html#ref_guide_mapping_custom_vhandler On Sun, Jul 10, 2011 at 3:12 PM, Todd Nine t...@spidertracks.com wrote: Hey guys, I'm also involved in this project, I'm the developer for this plugin. https://github.com/riptano/hector-jpa/ The UUID class is used extensively by quite a few Cassandra developers. We've successfully used it as an identity, and my plug in recognizes the data type and can correctly serialize it. However, when not used in either a composite identity or an identity, it appears that Open JPA does not correctly interpret the type and create an instance of a persistent UUID in the list of fields for the entity. Here is the UUID class we're using. http://johannburkard.de/software/uuid/ I definitely want to provide native support for this value in my plugin over string converter serialization. How can I get the open JPA enhancer to add it as a persistent field to the Entity during enhancement? I'll need to document this for my plugin, any help would be greatly appreciated. Todd On Fri, 2011-07-08 at 09:08 -0500, Rick Curtis wrote: Should your UUID class have an embeddable annotation also?
Re: Enhancement skipping field
Todd - I don't think the problem is that the enhancer skips the field, its the fact that we don't know how the map the UUID field. You might be able to write a customer value handler [1] ? Take a look at that and see if it would work for you. Let me know how it goes. [1] http://openjpa.apache.org/builds/latest/docs/manual/manual.html#ref_guide_mapping_custom_vhandler On Sun, Jul 10, 2011 at 3:12 PM, Todd Nine t...@spidertracks.com wrote: Hey guys, I'm also involved in this project, I'm the developer for this plugin. https://github.com/riptano/hector-jpa/ The UUID class is used extensively by quite a few Cassandra developers. We've successfully used it as an identity, and my plug in recognizes the data type and can correctly serialize it. However, when not used in either a composite identity or an identity, it appears that Open JPA does not correctly interpret the type and create an instance of a persistent UUID in the list of fields for the entity. Here is the UUID class we're using. http://johannburkard.de/software/uuid/ I definitely want to provide native support for this value in my plugin over string converter serialization. How can I get the open JPA enhancer to add it as a persistent field to the Entity during enhancement? I'll need to document this for my plugin, any help would be greatly appreciated. Todd On Fri, 2011-07-08 at 09:08 -0500, Rick Curtis wrote: Should your UUID class have an embeddable annotation also? On Thu, Jul 7, 2011 at 4:27 PM, Matthew Goodson matt...@spidertracks.co.nzwrote: Hi, Kevin: We're using maven and it is picking up the Phone_ class and generating the warning here's the link for the uuid class that we're using https://github.com/stephenc/eaio-uuid/blob/master/src/main/java/com/eaio/uuid/UUID.java And the persistence xml... persistence xmlns=http://java.sun.com/xml/ns/persistence; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd; version=2.0 persistence-unit name=openjpa providerorg.apache.openjpa.persistence.PersistenceProviderImpl/provider !-- base package -- classcom.spidertracks.aviator.model.Persistable/class classcom.spidertracks.aviator.model.UuidEntity/class !-- cluster -- classcom.spidertracks.aviator.model.cluster.ClusterRegion/class classcom.spidertracks.aviator.model.cluster.SpiderRegion/class !-- security -- classcom.spidertracks.aviator.model.security.AviatorRememberMeToken/class !-- sms -- classcom.spidertracks.aviator.model.sms.PhoneValidationMessage/class classcom.spidertracks.aviator.model.sms.ReceivedSmsMessage/class classcom.spidertracks.aviator.model.sms.SentSmsMessage/class classcom.spidertracks.aviator.model.sms.SmsMessage/class classcom.spidertracks.aviator.model.sms.SosClosedMessage/class classcom.spidertracks.aviator.model.sms.SosInvalidResponseMessage/class classcom.spidertracks.aviator.model.sms.SosMessage/class classcom.spidertracks.aviator.model.sms.SosTierOneMessage/class classcom.spidertracks.aviator.model.sms.SosTierOneReopenedUserMessage/class classcom.spidertracks.aviator.model.sms.SosTierTwoMessage/class classcom.spidertracks.aviator.model.sms.SosTierTwoReopenedUserMessage/class classcom.spidertracks.aviator.model.sms.SosTierTwoUserMessage/class !-- Sos -- classcom.spidertracks.aviator.model.sos.ContactedPerson/class classcom.spidertracks.aviator.model.sos.OpenHistory/class classcom.spidertracks.aviator.model.sos.SoS/class !-- spider -- classcom.spidertracks.aviator.model.spider.Spider/class !-- message -- classcom.spidertracks.aviator.model.spider.message.AlertAcknowlege/class classcom.spidertracks.aviator.model.spider.message.ConfigMessageUpdate/class classcom.spidertracks.aviator.model.spider.message.DistanceSettings/class classcom.spidertracks.aviator.model.spider.message.MobileTerminatedConfirmation/class classcom.spidertracks.aviator.model.spider.message.SpiderUpdate/class classcom.spidertracks.aviator.model.spider.message.SpiderwatchSettings/class classcom.spidertracks.aviator.model.spider.message.TimeDistanceSettings/class classcom.spidertracks.aviator.model.spider.message.TimeSettings/class classcom.spidertracks.aviator.model.spider.message.WatchOff/class classcom.spidertracks.aviator.model.spider.message.WatchOn/class !-- user -- classcom.spidertracks.aviator.model.user.ContactLink/class classcom.spidertracks.aviator.model.user.Address/class classcom.spidertracks.aviator.model.user.Customer/class classcom.spidertracks.aviator.model.user.EmailConfirmationToken/class
Re: Enhancement skipping field
Hey Rick, Adding the handler makes the field appear in the field list for my plugin. However my plugin currently doesn't support value handlers. I need to add this functionality, what is the best class to use as an example for reading this meta data and invoking it at runtime? Thanks, Todd On Tue, 2011-07-12 at 11:18 -0500, Rick Curtis wrote: Todd - I don't think the problem is that the enhancer skips the field, its the fact that we don't know how the map the UUID field. You might be able to write a customer value handler [1] ? Take a look at that and see if it would work for you. Let me know how it goes. [1] http://openjpa.apache.org/builds/latest/docs/manual/manual.html#ref_guide_mapping_custom_vhandler On Sun, Jul 10, 2011 at 3:12 PM, Todd Nine t...@spidertracks.com wrote: Hey guys, I'm also involved in this project, I'm the developer for this plugin. https://github.com/riptano/hector-jpa/ The UUID class is used extensively by quite a few Cassandra developers. We've successfully used it as an identity, and my plug in recognizes the data type and can correctly serialize it. However, when not used in either a composite identity or an identity, it appears that Open JPA does not correctly interpret the type and create an instance of a persistent UUID in the list of fields for the entity. Here is the UUID class we're using. http://johannburkard.de/software/uuid/ I definitely want to provide native support for this value in my plugin over string converter serialization. How can I get the open JPA enhancer to add it as a persistent field to the Entity during enhancement? I'll need to document this for my plugin, any help would be greatly appreciated. Todd On Fri, 2011-07-08 at 09:08 -0500, Rick Curtis wrote: Should your UUID class have an embeddable annotation also? On Thu, Jul 7, 2011 at 4:27 PM, Matthew Goodson matt...@spidertracks.co.nzwrote: Hi, Kevin: We're using maven and it is picking up the Phone_ class and generating the warning here's the link for the uuid class that we're using https://github.com/stephenc/eaio-uuid/blob/master/src/main/java/com/eaio/uuid/UUID.java And the persistence xml... persistence xmlns=http://java.sun.com/xml/ns/persistence; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd; version=2.0 persistence-unit name=openjpa providerorg.apache.openjpa.persistence.PersistenceProviderImpl/provider !-- base package -- classcom.spidertracks.aviator.model.Persistable/class classcom.spidertracks.aviator.model.UuidEntity/class !-- cluster -- classcom.spidertracks.aviator.model.cluster.ClusterRegion/class classcom.spidertracks.aviator.model.cluster.SpiderRegion/class !-- security -- classcom.spidertracks.aviator.model.security.AviatorRememberMeToken/class !-- sms -- classcom.spidertracks.aviator.model.sms.PhoneValidationMessage/class classcom.spidertracks.aviator.model.sms.ReceivedSmsMessage/class classcom.spidertracks.aviator.model.sms.SentSmsMessage/class classcom.spidertracks.aviator.model.sms.SmsMessage/class classcom.spidertracks.aviator.model.sms.SosClosedMessage/class classcom.spidertracks.aviator.model.sms.SosInvalidResponseMessage/class classcom.spidertracks.aviator.model.sms.SosMessage/class classcom.spidertracks.aviator.model.sms.SosTierOneMessage/class classcom.spidertracks.aviator.model.sms.SosTierOneReopenedUserMessage/class classcom.spidertracks.aviator.model.sms.SosTierTwoMessage/class classcom.spidertracks.aviator.model.sms.SosTierTwoReopenedUserMessage/class classcom.spidertracks.aviator.model.sms.SosTierTwoUserMessage/class !-- Sos -- classcom.spidertracks.aviator.model.sos.ContactedPerson/class classcom.spidertracks.aviator.model.sos.OpenHistory/class classcom.spidertracks.aviator.model.sos.SoS/class !-- spider -- classcom.spidertracks.aviator.model.spider.Spider/class !-- message -- classcom.spidertracks.aviator.model.spider.message.AlertAcknowlege/class classcom.spidertracks.aviator.model.spider.message.ConfigMessageUpdate/class classcom.spidertracks.aviator.model.spider.message.DistanceSettings/class classcom.spidertracks.aviator.model.spider.message.MobileTerminatedConfirmation/class classcom.spidertracks.aviator.model.spider.message.SpiderUpdate/class classcom.spidertracks.aviator.model.spider.message.SpiderwatchSettings/class classcom.spidertracks.aviator.model.spider.message.TimeDistanceSettings/class
Re: Enhancement skipping field
Todd - I'm stretching a bit here as I've never actually experimented with this code but I'd start out by looking at org.apache.openjpa.persistence.jdbc.annotations.NonstandardMappingEntity and org.apache.openjpa.persistence.jdbc.annotations.TestNonstandardMappingAnnotations. It appears that you could add a @Strategy annotation to your UUID field and point it at your handler. That *should* auto-magically wire up the proper calls to you handler. If/when you get that working, it looks like you should be able to add this strategy(UUID-customer handler) to the mapping defaults. On Tue, Jul 12, 2011 at 3:58 PM, Todd Nine t...@spidertracks.com wrote: Hey Rick, Adding the handler makes the field appear in the field list for my plugin. However my plugin currently doesn't support value handlers. I need to add this functionality, what is the best class to use as an example for reading this meta data and invoking it at runtime? Thanks, Todd On Tue, 2011-07-12 at 11:18 -0500, Rick Curtis wrote: Todd - I don't think the problem is that the enhancer skips the field, its the fact that we don't know how the map the UUID field. You might be able to write a customer value handler [1] ? Take a look at that and see if it would work for you. Let me know how it goes. [1] http://openjpa.apache.org/builds/latest/docs/manual/manual.html#ref_guide_mapping_custom_vhandler On Sun, Jul 10, 2011 at 3:12 PM, Todd Nine t...@spidertracks.com wrote: Hey guys, I'm also involved in this project, I'm the developer for this plugin. https://github.com/riptano/hector-jpa/ The UUID class is used extensively by quite a few Cassandra developers. We've successfully used it as an identity, and my plug in recognizes the data type and can correctly serialize it. However, when not used in either a composite identity or an identity, it appears that Open JPA does not correctly interpret the type and create an instance of a persistent UUID in the list of fields for the entity. Here is the UUID class we're using. http://johannburkard.de/software/uuid/ I definitely want to provide native support for this value in my plugin over string converter serialization. How can I get the open JPA enhancer to add it as a persistent field to the Entity during enhancement? I'll need to document this for my plugin, any help would be greatly appreciated. Todd On Fri, 2011-07-08 at 09:08 -0500, Rick Curtis wrote: Should your UUID class have an embeddable annotation also? On Thu, Jul 7, 2011 at 4:27 PM, Matthew Goodson matt...@spidertracks.co.nzwrote: Hi, Kevin: We're using maven and it is picking up the Phone_ class and generating the warning here's the link for the uuid class that we're using https://github.com/stephenc/eaio-uuid/blob/master/src/main/java/com/eaio/uuid/UUID.java And the persistence xml... persistence xmlns=http://java.sun.com/xml/ns/persistence; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd; version=2.0 persistence-unit name=openjpa providerorg.apache.openjpa.persistence.PersistenceProviderImpl/provider !-- base package -- classcom.spidertracks.aviator.model.Persistable/class classcom.spidertracks.aviator.model.UuidEntity/class !-- cluster -- classcom.spidertracks.aviator.model.cluster.ClusterRegion/class classcom.spidertracks.aviator.model.cluster.SpiderRegion/class !-- security -- classcom.spidertracks.aviator.model.security.AviatorRememberMeToken/class !-- sms -- classcom.spidertracks.aviator.model.sms.PhoneValidationMessage/class classcom.spidertracks.aviator.model.sms.ReceivedSmsMessage/class classcom.spidertracks.aviator.model.sms.SentSmsMessage/class classcom.spidertracks.aviator.model.sms.SmsMessage/class classcom.spidertracks.aviator.model.sms.SosClosedMessage/class classcom.spidertracks.aviator.model.sms.SosInvalidResponseMessage/class classcom.spidertracks.aviator.model.sms.SosMessage/class classcom.spidertracks.aviator.model.sms.SosTierOneMessage/class classcom.spidertracks.aviator.model.sms.SosTierOneReopenedUserMessage/class classcom.spidertracks.aviator.model.sms.SosTierTwoMessage/class classcom.spidertracks.aviator.model.sms.SosTierTwoReopenedUserMessage/class classcom.spidertracks.aviator.model.sms.SosTierTwoUserMessage/class !-- Sos -- classcom.spidertracks.aviator.model.sos.ContactedPerson/class classcom.spidertracks.aviator.model.sos.OpenHistory/class
Re: Enhancement skipping field
Hi, we are getting closer! We added a strategy the uuid field @Persistent @Strategy(com.datastax.hectorjpa.strategy.NoOpHandler) private UUID id; So now it successfully enhances the class which now looks like this @javax.persistence.metamodel.StaticMetamodel (value=com.spidertracks.aviator.model.user.Phone.class) @javax.annotation.Generated (value=org.apache.openjpa.persistence.meta.AnnotationProcessor6,date=Wed Jul 13 13:00:16 NZST 2011) public class Phone_ { public static volatile SingularAttributePhone,String countryIdd; public static volatile SingularAttributePhone,UUID id; public static volatile SingularAttributePhone,String iddCountryCode; public static volatile SingularAttributePhone,String number; public static volatile SingularAttributePhone,PhoneType type; } But when we go to load something it gets the list of fields, which includes the id field, but this field is then stripped out when he meta data is resolved. This happens on line 164 of the ClassMetaData class in the resolveMeta method and I get the following warning. 2011-07-13 03:16:23,295Z WARN [main] Field com.spidertracks.aviator.model.user.Phone.id is not a type that is persistent by default. If you want this field to be persistent, you have to explicitly set it to persistent in your metadata. Thanks On Wed, Jul 13, 2011 at 9:25 AM, Rick Curtis curti...@gmail.com wrote: Todd - I'm stretching a bit here as I've never actually experimented with this code but I'd start out by looking at org.apache.openjpa.persistence.jdbc.annotations.NonstandardMappingEntity and org.apache.openjpa.persistence.jdbc.annotations.TestNonstandardMappingAnnotations. It appears that you could add a @Strategy annotation to your UUID field and point it at your handler. That *should* auto-magically wire up the proper calls to you handler. If/when you get that working, it looks like you should be able to add this strategy(UUID-customer handler) to the mapping defaults. On Tue, Jul 12, 2011 at 3:58 PM, Todd Nine t...@spidertracks.com wrote: Hey Rick, Adding the handler makes the field appear in the field list for my plugin. However my plugin currently doesn't support value handlers. I need to add this functionality, what is the best class to use as an example for reading this meta data and invoking it at runtime? Thanks, Todd On Tue, 2011-07-12 at 11:18 -0500, Rick Curtis wrote: Todd - I don't think the problem is that the enhancer skips the field, its the fact that we don't know how the map the UUID field. You might be able to write a customer value handler [1] ? Take a look at that and see if it would work for you. Let me know how it goes. [1] http://openjpa.apache.org/builds/latest/docs/manual/manual.html#ref_guide_mapping_custom_vhandler On Sun, Jul 10, 2011 at 3:12 PM, Todd Nine t...@spidertracks.com wrote: Hey guys, I'm also involved in this project, I'm the developer for this plugin. https://github.com/riptano/hector-jpa/ The UUID class is used extensively by quite a few Cassandra developers. We've successfully used it as an identity, and my plug in recognizes the data type and can correctly serialize it. However, when not used in either a composite identity or an identity, it appears that Open JPA does not correctly interpret the type and create an instance of a persistent UUID in the list of fields for the entity. Here is the UUID class we're using. http://johannburkard.de/software/uuid/ I definitely want to provide native support for this value in my plugin over string converter serialization. How can I get the open JPA enhancer to add it as a persistent field to the Entity during enhancement? I'll need to document this for my plugin, any help would be greatly appreciated. Todd On Fri, 2011-07-08 at 09:08 -0500, Rick Curtis wrote: Should your UUID class have an embeddable annotation also? On Thu, Jul 7, 2011 at 4:27 PM, Matthew Goodson matt...@spidertracks.co.nzwrote: Hi, Kevin: We're using maven and it is picking up the Phone_ class and generating the warning here's the link for the uuid class that we're using https://github.com/stephenc/eaio-uuid/blob/master/src/main/java/com/eaio/uuid/UUID.java And the persistence xml... persistence xmlns=http://java.sun.com/xml/ns/persistence; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd; version=2.0 persistence-unit name=openjpa providerorg.apache.openjpa.persistence.PersistenceProviderImpl/provider !-- base package --
Re: Enhancement skipping field
I think we can ignore the warning about Phone_ for now. The enhancer will not automatically ignore the MetaModel classes, but it shouldn't be hurting anything. I haven't been able to reproduce the other warning. If your project is available on github please post a link - that might be the quickest way to get to the bottom of the problem. If not , can you post the settings you use when running the enhancer? It sounds like you're using the maven plugin, and it'd help us if we could run the same way. -mike On Thu, Jul 7, 2011 at 5:15 PM, Matthew Goodson matt...@spidertracks.co.nzwrote: Yeah entity_ classes don't need to enhanced but the plugin doesn't exclude them but it doesn't affect the application so I'm not too worried. Its the Phone.id field that is not being enhanced that's causing my problem. Thanks On Fri, Jul 8, 2011 at 9:35 AM, Kevin Sutter kwsut...@gmail.com wrote: Hi Matthew, Not sure which maven plugin or ant script is being used for your build-time enhancement, but can it be modified to exclude the generated entity_ classes? These should not be run through the enhancer. Also, just to verify... You are generating these entity_ classes on purpose, correct? These underscored classes are generated metamodel classes in support of the Metamodel and Criteria APIs. Is your application using one or both of these new features in JPA 2.0? Just checking... Thanks, Kevin On Thu, Jul 7, 2011 at 4:27 PM, Matthew Goodson matt...@spidertracks.co.nzwrote: Hi, Kevin: We're using maven and it is picking up the Phone_ class and generating the warning here's the link for the uuid class that we're using https://github.com/stephenc/eaio-uuid/blob/master/src/main/java/com/eaio/uuid/UUID.java And the persistence xml... persistence xmlns=http://java.sun.com/xml/ns/persistence; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd; version=2.0 persistence-unit name=openjpa providerorg.apache.openjpa.persistence.PersistenceProviderImpl/provider !-- base package -- classcom.spidertracks.aviator.model.Persistable/class classcom.spidertracks.aviator.model.UuidEntity/class !-- cluster -- classcom.spidertracks.aviator.model.cluster.ClusterRegion/class classcom.spidertracks.aviator.model.cluster.SpiderRegion/class !-- security -- classcom.spidertracks.aviator.model.security.AviatorRememberMeToken/class !-- sms -- classcom.spidertracks.aviator.model.sms.PhoneValidationMessage/class classcom.spidertracks.aviator.model.sms.ReceivedSmsMessage/class classcom.spidertracks.aviator.model.sms.SentSmsMessage/class classcom.spidertracks.aviator.model.sms.SmsMessage/class classcom.spidertracks.aviator.model.sms.SosClosedMessage/class classcom.spidertracks.aviator.model.sms.SosInvalidResponseMessage/class classcom.spidertracks.aviator.model.sms.SosMessage/class classcom.spidertracks.aviator.model.sms.SosTierOneMessage/class classcom.spidertracks.aviator.model.sms.SosTierOneReopenedUserMessage/class classcom.spidertracks.aviator.model.sms.SosTierTwoMessage/class classcom.spidertracks.aviator.model.sms.SosTierTwoReopenedUserMessage/class classcom.spidertracks.aviator.model.sms.SosTierTwoUserMessage/class !-- Sos -- classcom.spidertracks.aviator.model.sos.ContactedPerson/class classcom.spidertracks.aviator.model.sos.OpenHistory/class classcom.spidertracks.aviator.model.sos.SoS/class !-- spider -- classcom.spidertracks.aviator.model.spider.Spider/class !-- message -- classcom.spidertracks.aviator.model.spider.message.AlertAcknowlege/class classcom.spidertracks.aviator.model.spider.message.ConfigMessageUpdate/class classcom.spidertracks.aviator.model.spider.message.DistanceSettings/class classcom.spidertracks.aviator.model.spider.message.MobileTerminatedConfirmation/class classcom.spidertracks.aviator.model.spider.message.SpiderUpdate/class classcom.spidertracks.aviator.model.spider.message.SpiderwatchSettings/class classcom.spidertracks.aviator.model.spider.message.TimeDistanceSettings/class classcom.spidertracks.aviator.model.spider.message.TimeSettings/class classcom.spidertracks.aviator.model.spider.message.WatchOff/class classcom.spidertracks.aviator.model.spider.message.WatchOn/class !-- user -- classcom.spidertracks.aviator.model.user.ContactLink/class classcom.spidertracks.aviator.model.user.Address/class classcom.spidertracks.aviator.model.user.Customer/class classcom.spidertracks.aviator.model.user.EmailConfirmationToken/class
Re: Enhancement skipping field
Should your UUID class have an embeddable annotation also? On Thu, Jul 7, 2011 at 4:27 PM, Matthew Goodson matt...@spidertracks.co.nzwrote: Hi, Kevin: We're using maven and it is picking up the Phone_ class and generating the warning here's the link for the uuid class that we're using https://github.com/stephenc/eaio-uuid/blob/master/src/main/java/com/eaio/uuid/UUID.java And the persistence xml... persistence xmlns=http://java.sun.com/xml/ns/persistence; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd; version=2.0 persistence-unit name=openjpa providerorg.apache.openjpa.persistence.PersistenceProviderImpl/provider !-- base package -- classcom.spidertracks.aviator.model.Persistable/class classcom.spidertracks.aviator.model.UuidEntity/class !-- cluster -- classcom.spidertracks.aviator.model.cluster.ClusterRegion/class classcom.spidertracks.aviator.model.cluster.SpiderRegion/class !-- security -- classcom.spidertracks.aviator.model.security.AviatorRememberMeToken/class !-- sms -- classcom.spidertracks.aviator.model.sms.PhoneValidationMessage/class classcom.spidertracks.aviator.model.sms.ReceivedSmsMessage/class classcom.spidertracks.aviator.model.sms.SentSmsMessage/class classcom.spidertracks.aviator.model.sms.SmsMessage/class classcom.spidertracks.aviator.model.sms.SosClosedMessage/class classcom.spidertracks.aviator.model.sms.SosInvalidResponseMessage/class classcom.spidertracks.aviator.model.sms.SosMessage/class classcom.spidertracks.aviator.model.sms.SosTierOneMessage/class classcom.spidertracks.aviator.model.sms.SosTierOneReopenedUserMessage/class classcom.spidertracks.aviator.model.sms.SosTierTwoMessage/class classcom.spidertracks.aviator.model.sms.SosTierTwoReopenedUserMessage/class classcom.spidertracks.aviator.model.sms.SosTierTwoUserMessage/class !-- Sos -- classcom.spidertracks.aviator.model.sos.ContactedPerson/class classcom.spidertracks.aviator.model.sos.OpenHistory/class classcom.spidertracks.aviator.model.sos.SoS/class !-- spider -- classcom.spidertracks.aviator.model.spider.Spider/class !-- message -- classcom.spidertracks.aviator.model.spider.message.AlertAcknowlege/class classcom.spidertracks.aviator.model.spider.message.ConfigMessageUpdate/class classcom.spidertracks.aviator.model.spider.message.DistanceSettings/class classcom.spidertracks.aviator.model.spider.message.MobileTerminatedConfirmation/class classcom.spidertracks.aviator.model.spider.message.SpiderUpdate/class classcom.spidertracks.aviator.model.spider.message.SpiderwatchSettings/class classcom.spidertracks.aviator.model.spider.message.TimeDistanceSettings/class classcom.spidertracks.aviator.model.spider.message.TimeSettings/class classcom.spidertracks.aviator.model.spider.message.WatchOff/class classcom.spidertracks.aviator.model.spider.message.WatchOn/class !-- user -- classcom.spidertracks.aviator.model.user.ContactLink/class classcom.spidertracks.aviator.model.user.Address/class classcom.spidertracks.aviator.model.user.Customer/class classcom.spidertracks.aviator.model.user.EmailConfirmationToken/class classcom.spidertracks.aviator.model.user.HashedUserToken/class classcom.spidertracks.aviator.model.user.InvitedPerson/class classcom.spidertracks.aviator.model.user.PasswordResetToken/class classcom.spidertracks.aviator.model.user.Person/class classcom.spidertracks.aviator.model.user.User/class classcom.spidertracks.aviator.model.user.Vehicle/class classcom.spidertracks.aviator.model.user.Phone/class properties property name=me.prettyprint.hom.classpathPrefix value=com.datastax.hectorjpa.bean / property name=me.prettyprint.hom.keyspace value=TestKeyspace / property name=me.prettyprint.hom.clusterName value=TestPool / property name=me.prettyprint.hom.hostList value=localhost:9161 / property name=openjpa.BrokerFactory value=abstractstore / property name=openjpa.abstractstore.AbstractStoreManager value=com.datastax.hectorjpa.store.CassandraStoreManager / property name=openjpa.MetaDataRepository value=com.datastax.hectorjpa.store.CassandraMetaDataRepository / property name=openjpa.Optimistic value=false / property name=openjpa.LockManager value=none / property name=openjpa.ConnectionURL value=localhost:9161 / !-- explicitly disable runtime enhancement support. It breaks a lot of proxy functionality needed for indexing -- property name=openjpa.RuntimeUnenhancedClasses value=unsupported / property name=openjpa.DetachState value=all(DetachedStateField=true)/ !-- Used to test the serialization property. If not set will default to java default serialization --
Re: Enhancement skipping field
Why are we attempting to enhance a generated metamodel class? class com.spidertracks.aviator.model.user.Phone_ Classes that end in an underscore were probably generated for the metamodel and/or criteria API usage. So, something seems out of whack with attempting to enhance these classes. Kevin On Thu, Jul 7, 2011 at 7:53 AM, Rick Curtis curti...@gmail.com wrote: Can you post your UUID class and the contents of your persistence.xml? Thanks, Rick On Wed, Jul 6, 2011 at 11:09 PM, Matthew Goodson matt...@spidertracks.co.nz wrote: Just adding the class for reference @Embeddable //public class Phone extends EmbeddedUUID implements WebOptionString, Serializable { public class Phone implements WebOptionString, Serializable { private static final long serialVersionUID = 1L; @Persistent private UUID id; @Persistent @NotEmpty(message = {phone.number.required}) @NumericString(message = {phone.number.digitsonly}) private String number; @Persistent private String countryIdd; @Persistent @NotNull(message = {phone.country.required}) private String iddCountryCode; @Persistent @NotNull(message = {phone.type.required}) private PhoneType type; public Phone() { id = new UUID(); } public Phone(String number, Country country, PhoneType type) { this(); this.number = number; this.type = type; setIddCountry(country); } public void setNumber(String number) { this.number = number; } public String getNumber() { return number; } public void setType(PhoneType type) { this.type = type; } public PhoneType getType() { return type; } @Override public String getDisplayString() { return number; } public void setIddCountry(Country country) { if (country != null) { this.iddCountryCode = country.getCode(); this.countryIdd = country.getIdd(); } } public Country getIddCountry() { if (iddCountryCode != null) { return CountryFactory.INSTANCE.getByCode(this.iddCountryCode); } return null; } public String getIddCountryCode() { return iddCountryCode; } public String getFullNumber() { return (countryIdd == null ? : countryIdd) + (number == null ? : number); } public void clone(Phone other) { Assert.notNull(other); setIddCountry(other.getIddCountry()); setNumber(other.getNumber()); setType(other.getType()); } public UUID getId() { return id; } public void setId(UUID id) { Assert.notNull(id); this.id = id; } } On Thu, Jul 7, 2011 at 3:36 PM, Matthew Goodson matt...@spidertracks.co.nzwrote: Hi guys. I have a problem with jpa enhancement. I am using version 2.1.0 and I am trying to get it to enhanced an object 'Phone' with a field 'id' which is of type com.eaio.UUID. However when I run the enhancement I get the 2 warnings below. Any ideas? 411 openjpa WARN [main] openjpa.MetaData - Field com.spidertracks.aviator.model.user.Phone.id is not a type that is persistent by default. If you want this field to be persistent, you have to explicitly set it to persistent in your metadata. 681 openjpa WARN [main] openjpa.Enhance - Type class com.spidertracks.aviator.model.user.Phone_ loaded by java.net.URLClassLoader@69dfe453 has no metadata; enhancing as persistence aware. If you intended for class com.spidertracks.aviator.model.user.Phone_ to be persistence-capable, then this means that OpenJPA could not find any metadata for class com.spidertracks.aviator.model.user.Phone_. This can happen if the directory containing your metadata is not in your CLASSPATH, or if your metadata files are not named properly. See the documentation on metadata placement for more information. -- *Rick Curtis*
Re: Enhancement skipping field
Hi, Kevin: We're using maven and it is picking up the Phone_ class and generating the warning here's the link for the uuid class that we're using https://github.com/stephenc/eaio-uuid/blob/master/src/main/java/com/eaio/uuid/UUID.java And the persistence xml... persistence xmlns=http://java.sun.com/xml/ns/persistence; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd; version=2.0 persistence-unit name=openjpa providerorg.apache.openjpa.persistence.PersistenceProviderImpl/provider !-- base package -- classcom.spidertracks.aviator.model.Persistable/class classcom.spidertracks.aviator.model.UuidEntity/class !-- cluster -- classcom.spidertracks.aviator.model.cluster.ClusterRegion/class classcom.spidertracks.aviator.model.cluster.SpiderRegion/class !-- security -- classcom.spidertracks.aviator.model.security.AviatorRememberMeToken/class !-- sms -- classcom.spidertracks.aviator.model.sms.PhoneValidationMessage/class classcom.spidertracks.aviator.model.sms.ReceivedSmsMessage/class classcom.spidertracks.aviator.model.sms.SentSmsMessage/class classcom.spidertracks.aviator.model.sms.SmsMessage/class classcom.spidertracks.aviator.model.sms.SosClosedMessage/class classcom.spidertracks.aviator.model.sms.SosInvalidResponseMessage/class classcom.spidertracks.aviator.model.sms.SosMessage/class classcom.spidertracks.aviator.model.sms.SosTierOneMessage/class classcom.spidertracks.aviator.model.sms.SosTierOneReopenedUserMessage/class classcom.spidertracks.aviator.model.sms.SosTierTwoMessage/class classcom.spidertracks.aviator.model.sms.SosTierTwoReopenedUserMessage/class classcom.spidertracks.aviator.model.sms.SosTierTwoUserMessage/class !-- Sos -- classcom.spidertracks.aviator.model.sos.ContactedPerson/class classcom.spidertracks.aviator.model.sos.OpenHistory/class classcom.spidertracks.aviator.model.sos.SoS/class !-- spider -- classcom.spidertracks.aviator.model.spider.Spider/class !-- message -- classcom.spidertracks.aviator.model.spider.message.AlertAcknowlege/class classcom.spidertracks.aviator.model.spider.message.ConfigMessageUpdate/class classcom.spidertracks.aviator.model.spider.message.DistanceSettings/class classcom.spidertracks.aviator.model.spider.message.MobileTerminatedConfirmation/class classcom.spidertracks.aviator.model.spider.message.SpiderUpdate/class classcom.spidertracks.aviator.model.spider.message.SpiderwatchSettings/class classcom.spidertracks.aviator.model.spider.message.TimeDistanceSettings/class classcom.spidertracks.aviator.model.spider.message.TimeSettings/class classcom.spidertracks.aviator.model.spider.message.WatchOff/class classcom.spidertracks.aviator.model.spider.message.WatchOn/class !-- user -- classcom.spidertracks.aviator.model.user.ContactLink/class classcom.spidertracks.aviator.model.user.Address/class classcom.spidertracks.aviator.model.user.Customer/class classcom.spidertracks.aviator.model.user.EmailConfirmationToken/class classcom.spidertracks.aviator.model.user.HashedUserToken/class classcom.spidertracks.aviator.model.user.InvitedPerson/class classcom.spidertracks.aviator.model.user.PasswordResetToken/class classcom.spidertracks.aviator.model.user.Person/class classcom.spidertracks.aviator.model.user.User/class classcom.spidertracks.aviator.model.user.Vehicle/class classcom.spidertracks.aviator.model.user.Phone/class properties property name=me.prettyprint.hom.classpathPrefix value=com.datastax.hectorjpa.bean / property name=me.prettyprint.hom.keyspace value=TestKeyspace / property name=me.prettyprint.hom.clusterName value=TestPool / property name=me.prettyprint.hom.hostList value=localhost:9161 / property name=openjpa.BrokerFactory value=abstractstore / property name=openjpa.abstractstore.AbstractStoreManager value=com.datastax.hectorjpa.store.CassandraStoreManager / property name=openjpa.MetaDataRepository value=com.datastax.hectorjpa.store.CassandraMetaDataRepository / property name=openjpa.Optimistic value=false / property name=openjpa.LockManager value=none / property name=openjpa.ConnectionURL value=localhost:9161 / !-- explicitly disable runtime enhancement support. It breaks a lot of proxy functionality needed for indexing -- property name=openjpa.RuntimeUnenhancedClasses value=unsupported / property name=openjpa.DetachState value=all(DetachedStateField=true)/ !-- Used to test the serialization property. If not set will default to java default serialization -- property name=com.datastax.jpa.embeddedserializer value=com.datastax.hectorjpa.serialize.XStreamSerializer / property name=openjpa.EntityManagerFactory
Re: Enhancement skipping field
Hi Matthew, Not sure which maven plugin or ant script is being used for your build-time enhancement, but can it be modified to exclude the generated entity_ classes? These should not be run through the enhancer. Also, just to verify... You are generating these entity_ classes on purpose, correct? These underscored classes are generated metamodel classes in support of the Metamodel and Criteria APIs. Is your application using one or both of these new features in JPA 2.0? Just checking... Thanks, Kevin On Thu, Jul 7, 2011 at 4:27 PM, Matthew Goodson matt...@spidertracks.co.nzwrote: Hi, Kevin: We're using maven and it is picking up the Phone_ class and generating the warning here's the link for the uuid class that we're using https://github.com/stephenc/eaio-uuid/blob/master/src/main/java/com/eaio/uuid/UUID.java And the persistence xml... persistence xmlns=http://java.sun.com/xml/ns/persistence; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd; version=2.0 persistence-unit name=openjpa providerorg.apache.openjpa.persistence.PersistenceProviderImpl/provider !-- base package -- classcom.spidertracks.aviator.model.Persistable/class classcom.spidertracks.aviator.model.UuidEntity/class !-- cluster -- classcom.spidertracks.aviator.model.cluster.ClusterRegion/class classcom.spidertracks.aviator.model.cluster.SpiderRegion/class !-- security -- classcom.spidertracks.aviator.model.security.AviatorRememberMeToken/class !-- sms -- classcom.spidertracks.aviator.model.sms.PhoneValidationMessage/class classcom.spidertracks.aviator.model.sms.ReceivedSmsMessage/class classcom.spidertracks.aviator.model.sms.SentSmsMessage/class classcom.spidertracks.aviator.model.sms.SmsMessage/class classcom.spidertracks.aviator.model.sms.SosClosedMessage/class classcom.spidertracks.aviator.model.sms.SosInvalidResponseMessage/class classcom.spidertracks.aviator.model.sms.SosMessage/class classcom.spidertracks.aviator.model.sms.SosTierOneMessage/class classcom.spidertracks.aviator.model.sms.SosTierOneReopenedUserMessage/class classcom.spidertracks.aviator.model.sms.SosTierTwoMessage/class classcom.spidertracks.aviator.model.sms.SosTierTwoReopenedUserMessage/class classcom.spidertracks.aviator.model.sms.SosTierTwoUserMessage/class !-- Sos -- classcom.spidertracks.aviator.model.sos.ContactedPerson/class classcom.spidertracks.aviator.model.sos.OpenHistory/class classcom.spidertracks.aviator.model.sos.SoS/class !-- spider -- classcom.spidertracks.aviator.model.spider.Spider/class !-- message -- classcom.spidertracks.aviator.model.spider.message.AlertAcknowlege/class classcom.spidertracks.aviator.model.spider.message.ConfigMessageUpdate/class classcom.spidertracks.aviator.model.spider.message.DistanceSettings/class classcom.spidertracks.aviator.model.spider.message.MobileTerminatedConfirmation/class classcom.spidertracks.aviator.model.spider.message.SpiderUpdate/class classcom.spidertracks.aviator.model.spider.message.SpiderwatchSettings/class classcom.spidertracks.aviator.model.spider.message.TimeDistanceSettings/class classcom.spidertracks.aviator.model.spider.message.TimeSettings/class classcom.spidertracks.aviator.model.spider.message.WatchOff/class classcom.spidertracks.aviator.model.spider.message.WatchOn/class !-- user -- classcom.spidertracks.aviator.model.user.ContactLink/class classcom.spidertracks.aviator.model.user.Address/class classcom.spidertracks.aviator.model.user.Customer/class classcom.spidertracks.aviator.model.user.EmailConfirmationToken/class classcom.spidertracks.aviator.model.user.HashedUserToken/class classcom.spidertracks.aviator.model.user.InvitedPerson/class classcom.spidertracks.aviator.model.user.PasswordResetToken/class classcom.spidertracks.aviator.model.user.Person/class classcom.spidertracks.aviator.model.user.User/class classcom.spidertracks.aviator.model.user.Vehicle/class classcom.spidertracks.aviator.model.user.Phone/class properties property name=me.prettyprint.hom.classpathPrefix value=com.datastax.hectorjpa.bean / property name=me.prettyprint.hom.keyspace value=TestKeyspace / property name=me.prettyprint.hom.clusterName value=TestPool / property name=me.prettyprint.hom.hostList value=localhost:9161 / property name=openjpa.BrokerFactory value=abstractstore / property name=openjpa.abstractstore.AbstractStoreManager value=com.datastax.hectorjpa.store.CassandraStoreManager / property name=openjpa.MetaDataRepository value=com.datastax.hectorjpa.store.CassandraMetaDataRepository / property name=openjpa.Optimistic value=false / property name=openjpa.LockManager value=none / property
Re: Enhancement skipping field
Yeah entity_ classes don't need to enhanced but the plugin doesn't exclude them but it doesn't affect the application so I'm not too worried. Its the Phone.id field that is not being enhanced that's causing my problem. Thanks On Fri, Jul 8, 2011 at 9:35 AM, Kevin Sutter kwsut...@gmail.com wrote: Hi Matthew, Not sure which maven plugin or ant script is being used for your build-time enhancement, but can it be modified to exclude the generated entity_ classes? These should not be run through the enhancer. Also, just to verify... You are generating these entity_ classes on purpose, correct? These underscored classes are generated metamodel classes in support of the Metamodel and Criteria APIs. Is your application using one or both of these new features in JPA 2.0? Just checking... Thanks, Kevin On Thu, Jul 7, 2011 at 4:27 PM, Matthew Goodson matt...@spidertracks.co.nzwrote: Hi, Kevin: We're using maven and it is picking up the Phone_ class and generating the warning here's the link for the uuid class that we're using https://github.com/stephenc/eaio-uuid/blob/master/src/main/java/com/eaio/uuid/UUID.java And the persistence xml... persistence xmlns=http://java.sun.com/xml/ns/persistence; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd; version=2.0 persistence-unit name=openjpa providerorg.apache.openjpa.persistence.PersistenceProviderImpl/provider !-- base package -- classcom.spidertracks.aviator.model.Persistable/class classcom.spidertracks.aviator.model.UuidEntity/class !-- cluster -- classcom.spidertracks.aviator.model.cluster.ClusterRegion/class classcom.spidertracks.aviator.model.cluster.SpiderRegion/class !-- security -- classcom.spidertracks.aviator.model.security.AviatorRememberMeToken/class !-- sms -- classcom.spidertracks.aviator.model.sms.PhoneValidationMessage/class classcom.spidertracks.aviator.model.sms.ReceivedSmsMessage/class classcom.spidertracks.aviator.model.sms.SentSmsMessage/class classcom.spidertracks.aviator.model.sms.SmsMessage/class classcom.spidertracks.aviator.model.sms.SosClosedMessage/class classcom.spidertracks.aviator.model.sms.SosInvalidResponseMessage/class classcom.spidertracks.aviator.model.sms.SosMessage/class classcom.spidertracks.aviator.model.sms.SosTierOneMessage/class classcom.spidertracks.aviator.model.sms.SosTierOneReopenedUserMessage/class classcom.spidertracks.aviator.model.sms.SosTierTwoMessage/class classcom.spidertracks.aviator.model.sms.SosTierTwoReopenedUserMessage/class classcom.spidertracks.aviator.model.sms.SosTierTwoUserMessage/class !-- Sos -- classcom.spidertracks.aviator.model.sos.ContactedPerson/class classcom.spidertracks.aviator.model.sos.OpenHistory/class classcom.spidertracks.aviator.model.sos.SoS/class !-- spider -- classcom.spidertracks.aviator.model.spider.Spider/class !-- message -- classcom.spidertracks.aviator.model.spider.message.AlertAcknowlege/class classcom.spidertracks.aviator.model.spider.message.ConfigMessageUpdate/class classcom.spidertracks.aviator.model.spider.message.DistanceSettings/class classcom.spidertracks.aviator.model.spider.message.MobileTerminatedConfirmation/class classcom.spidertracks.aviator.model.spider.message.SpiderUpdate/class classcom.spidertracks.aviator.model.spider.message.SpiderwatchSettings/class classcom.spidertracks.aviator.model.spider.message.TimeDistanceSettings/class classcom.spidertracks.aviator.model.spider.message.TimeSettings/class classcom.spidertracks.aviator.model.spider.message.WatchOff/class classcom.spidertracks.aviator.model.spider.message.WatchOn/class !-- user -- classcom.spidertracks.aviator.model.user.ContactLink/class classcom.spidertracks.aviator.model.user.Address/class classcom.spidertracks.aviator.model.user.Customer/class classcom.spidertracks.aviator.model.user.EmailConfirmationToken/class classcom.spidertracks.aviator.model.user.HashedUserToken/class classcom.spidertracks.aviator.model.user.InvitedPerson/class classcom.spidertracks.aviator.model.user.PasswordResetToken/class classcom.spidertracks.aviator.model.user.Person/class classcom.spidertracks.aviator.model.user.User/class classcom.spidertracks.aviator.model.user.Vehicle/class classcom.spidertracks.aviator.model.user.Phone/class properties property name=me.prettyprint.hom.classpathPrefix value=com.datastax.hectorjpa.bean / property name=me.prettyprint.hom.keyspace value=TestKeyspace / property name=me.prettyprint.hom.clusterName value=TestPool / property name=me.prettyprint.hom.hostList value=localhost:9161 /
Re: Enhancement skipping field
Just adding the class for reference @Embeddable //public class Phone extends EmbeddedUUID implements WebOptionString, Serializable { public class Phone implements WebOptionString, Serializable { private static final long serialVersionUID = 1L; @Persistent private UUID id; @Persistent @NotEmpty(message = {phone.number.required}) @NumericString(message = {phone.number.digitsonly}) private String number; @Persistent private String countryIdd; @Persistent @NotNull(message = {phone.country.required}) private String iddCountryCode; @Persistent @NotNull(message = {phone.type.required}) private PhoneType type; public Phone() { id = new UUID(); } public Phone(String number, Country country, PhoneType type) { this(); this.number = number; this.type = type; setIddCountry(country); } public void setNumber(String number) { this.number = number; } public String getNumber() { return number; } public void setType(PhoneType type) { this.type = type; } public PhoneType getType() { return type; } @Override public String getDisplayString() { return number; } public void setIddCountry(Country country) { if (country != null) { this.iddCountryCode = country.getCode(); this.countryIdd = country.getIdd(); } } public Country getIddCountry() { if (iddCountryCode != null) { return CountryFactory.INSTANCE.getByCode(this.iddCountryCode); } return null; } public String getIddCountryCode() { return iddCountryCode; } public String getFullNumber() { return (countryIdd == null ? : countryIdd) + (number == null ? : number); } public void clone(Phone other) { Assert.notNull(other); setIddCountry(other.getIddCountry()); setNumber(other.getNumber()); setType(other.getType()); } public UUID getId() { return id; } public void setId(UUID id) { Assert.notNull(id); this.id = id; } } On Thu, Jul 7, 2011 at 3:36 PM, Matthew Goodson matt...@spidertracks.co.nzwrote: Hi guys. I have a problem with jpa enhancement. I am using version 2.1.0 and I am trying to get it to enhanced an object 'Phone' with a field 'id' which is of type com.eaio.UUID. However when I run the enhancement I get the 2 warnings below. Any ideas? 411 openjpa WARN [main] openjpa.MetaData - Field com.spidertracks.aviator.model.user.Phone.id is not a type that is persistent by default. If you want this field to be persistent, you have to explicitly set it to persistent in your metadata. 681 openjpa WARN [main] openjpa.Enhance - Type class com.spidertracks.aviator.model.user.Phone_ loaded by java.net.URLClassLoader@69dfe453 has no metadata; enhancing as persistence aware. If you intended for class com.spidertracks.aviator.model.user.Phone_ to be persistence-capable, then this means that OpenJPA could not find any metadata for class com.spidertracks.aviator.model.user.Phone_. This can happen if the directory containing your metadata is not in your CLASSPATH, or if your metadata files are not named properly. See the documentation on metadata placement for more information.