datanucleus

Connecting and Persisting to HBase

筅森魡賤 提交于 2019-12-21 17:39:34
问题 I just tried to connect to hbase which is part of the cloudera-vm using a java client. (192.168.56.102 is the inet ip of the vm) I use virtual box with host only network setting. So I can access the webUI of the hbase master @ http://192.168.56.102:60010/master.jsp Also my java client (worked well on the vm itself) established connection to 192.168.56.102:2181 But when it calls getMaster I get connection refused see log: 11/09/14 11:19:30 INFO zookeeper.ZooKeeper: Initiating client connection

“field jdoFieldFlags is conflicting” when using @MappedSuperclass on GAE/J & JPA

断了今生、忘了曾经 提交于 2019-12-20 07:26:27
问题 I got an error when querying to the entity extended by mappedsuperclass on GAE/J. MappedSuperClass import java.sql.Timestamp; import javax.persistence.MappedSuperclass; @MappedSuperclass public abstract class AbstractModel { private String lastModifiedBy; private Timestamp createTimestamp; private Timestamp modifyTimestamp; private Integer version; // setters & getters } Entity import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name =

Datanucleus JPA 2 Level 2 cache in Google AppEngine

你离开我真会死。 提交于 2019-12-19 10:25:23
问题 What am I missing in the following configuration that my Datanucleus JPA 2 Level 2 cache is not using Google App Engine Memcache service? I am using the GAE 1.7.2 SDK. In the persistence.xml: <persistence-unit name="transactions-optional"> <provider>org.datanucleus.api.jpa.PersistenceProviderImpl</provider> <properties> <property name="datanucleus.NontransactionalRead" value="true"/> <property name="datanucleus.NontransactionalWrite" value="true"/> <property name="datanucleus.ConnectionURL"

Multiple unique constraints in JPA

此生再无相见时 提交于 2019-12-18 10:08:44
问题 Is there a way to specify using JPA that there should be multiple unique constraints on different sets of columns? @Entity @Table(name="person", uniqueConstraints=@UniqueConstraint(columnNames={"code", "uid"})) public class Person { // Unique on code and uid public String code; public String uid; // Unique on username public String username; public String name; public String email; } I have seen a hibernate specific annotation but I am trying to avoid vendor specific solutions as we are still

How can SBT generate metamodel classes from model classes using DataNucleus?

我们两清 提交于 2019-12-14 02:33:10
问题 How can I generate metamodel classes (like QClient, QProduct, QInvoice) from a persistence model classes (like Client, Product, Invoice) so that a JDOQL typesafe queries can be employed? In particular, I'm interested on generating the metamodel classes and also run bytecode enhancement on persistence classes, via SBT and using DataNucleus with JDO annotations. This question is related to How can I run DataNucleus Bytecode Enhancer from SBT? 回答1: In a nutshell, you need to define functions in

JDODetachedFieldAccessException: You have just attempted to access field “attachment” yet this field was not detached when you detached the object

流过昼夜 提交于 2019-12-13 13:16:12
问题 Entity class: public class CustomerSurvey implements Serializable { @Id @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="CUSTOMER_SURVEY_SEQUENCE") @Column(name = "SURVEYID", nullable = false) private String surveyId; @Column(name="ATTACHMENT") @Lob private byte[] attachment; .... Persistence class/logic: public List<CustomerSurvey> getSurveysByCustomer(String custNo) throws WorkServiceException { EntityManager em = entityManagerFactory.createEntityManager(); Query query = em

JDO unique fields in Google App Engine

孤街浪徒 提交于 2019-12-13 02:27:21
问题 According to this, Google App Engine's JDO implementation does not support JDO @Unique annotation. Is this still so? For example, I have this class: @PersistenceCapable public class User { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key key; @Persistent private String email; @Persistent private String sessionToken; ... } Obviously the key is unique, but I also wanted to have unique email and sessionToken . If @Unique is not supported, what's the best way to

Mongo/DataNucleus/JPA with embedded type query gives: Cannot find type of (part of) … since symbol has no type; implicit variable?

拟墨画扇 提交于 2019-12-13 00:09:23
问题 I am trying this JPA query "SELECT ml FROM MediaLibrary ml WHERE ml.media.id = :id" and I get this error message: "Cannot find type of (part of) ml.media.id since symbol has no type; implicit variable?" I realize that should probably be some kind of MEMBER OF query instead but I tried that with the same result. I am looking to find the media library containing the media with the id equal to the given value. Simplified code: @Entity( name = "MediaLibrary" ) @Table( name = "MediaLibrary" )

example using memcache with jpa entitymanager on JGAE?

可紊 提交于 2019-12-12 10:03:37
问题 any example on using memcache/general cache with jpa entitymanager on JGAE? or the only way to do it is manually put/set memcache on service layer? 回答1: DataNucleus docs define adequately how to use the JDO/JPA L2 cache. http://www.datanucleus.org/products/accessplatform_1_1/jpa/cache.html in the case of GAE/J memcache the L2 cache should be "javax.cache". 来源: https://stackoverflow.com/questions/1978428/example-using-memcache-with-jpa-entitymanager-on-jgae

Generate JDO objects from existing database

允我心安 提交于 2019-12-12 09:04:01
问题 Is there a tool to generate JDO objects from an existing database? I prefer a awesome looking Eclipse plugin which i could use to generate and maintain the object but it seems that this is currently not existing. Are other, simple tools to generate the database objects? 回答1: JDO objects are not simple wrappers around database rows (although you can implement your JDO objects as simple wrappers around database rows if that is what you wish). As such, most automated tools will not know how the