From user-return-12184-archive-asf-public=cust-asf.ponee.io@cayenne.apache.org Wed Jul 25 11:51:59 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id D37ED18062C for ; Wed, 25 Jul 2018 11:51:58 +0200 (CEST) Received: (qmail 2506 invoked by uid 500); 25 Jul 2018 09:51:57 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 2493 invoked by uid 99); 25 Jul 2018 09:51:57 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jul 2018 09:51:57 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 9E71A180533 for ; Wed, 25 Jul 2018 09:51:56 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.802 X-Spam-Level: X-Spam-Status: No, score=-0.802 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=objectstyle.org header.b=qZrvKEU8; dkim=pass (2048-bit key) header.d=messagingengine.com header.b=s4kmrnEn Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id WZ_B7xrrMjuy for ; Wed, 25 Jul 2018 09:51:08 +0000 (UTC) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 28F1F6259B for ; Wed, 25 Jul 2018 08:09:27 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 1FAFD21C97; Wed, 25 Jul 2018 04:09:27 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Wed, 25 Jul 2018 04:09:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=objectstyle.org; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=mesmtp; bh=oHJmir3DMx6LF0 FcY/GOH2Ua8g620dxSGKXeDa08cSY=; b=qZrvKEU8qk2uLQRmr0NudTbyjtn/Th 2UndZ9iY9ea1X045Y84Eg66XCiCYLPtkLe8IaOEim8kRnXKw90LHaLHBR3pzxA3w VgubEfhvAfQw3Hk7RribWTOfJVKG+GZiP2pfai7HlxZjPwcoCm1L5Eh/o8OMrzYs E11djJUhFtwsg= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=oHJmir 3DMx6LF0FcY/GOH2Ua8g620dxSGKXeDa08cSY=; b=s4kmrnEnue1uULVVyo9zoz b94N+iBs3rXqoviBCd4iJQxE/oZOXSXC07ovZOU4SIIpOBrYhttCHborvb/ugHQy 7qoFmrjX480mKnd9FudHNivtF33qPHrJ1FQDmj70/tlOapDy/ocHFYBCRETUfLFk bzHIKbtbrstMQTldr3ollc69aBTN82E1vQc5yMVi4gqSbvK7JFxsX4a/8fTFK1hz DrdWh/IFfxxm2pO+ZOx47Jun/I1xXdEPMQ36lWXHAVoe8wNSibo3t8Xu9MMdhrzM 28Kh8VcJUZh1DvtqJJ1uuJ9x1Gl81dkYiYOLgA+Q8JdnQqcDOm5z5a0/JHbpr+mw == X-ME-Proxy: X-ME-Sender: Received: from [192.168.1.137] (unknown [37.17.49.228]) by mail.messagingengine.com (Postfix) with ESMTPA id CECD510269; Wed, 25 Jul 2018 04:09:25 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: CayenneDataObject is likely not mapped From: Andrus Adamchik X-Priority: 3 In-Reply-To: Date: Wed, 25 Jul 2018 11:09:23 +0300 Cc: 1091643978@qq.com Content-Transfer-Encoding: quoted-printable Message-Id: <07952366-0809-4E43-A0F7-B8548266B572@objectstyle.org> References: To: user@cayenne.apache.org X-Mailer: Apple Mail (2.3445.9.1) See my reply in "is is possible to dynamically create entity in cayenne" = thread. An explicit reverse-engineering step is required. Andrus > On Jul 22, 2018, at 6:46 PM, =E5=88=98=E6=B3=A2 <1091643978@qq.com> = wrote: >=20 > ServerRuntime cayenneRuntime =3D ServerRuntime.builder() > .addConfig("cayenne-project.xml") > .build(); > ObjectContext context =3D cayenneRuntime.newContext(); >=20 >=20 > DataObject person =3D new CayenneDataObject(); > person.setObjectId(new ObjectId("Person")); > context.registerNewObject(person); >=20 > String name =3D (String) person.readProperty("name"); > Exception in thread "main" java.lang.IllegalArgumentException: Can't = find ObjEntity for Persistent class: = org.apache.cayenne.CayenneDataObject, class is likely not mapped. > at = org.apache.cayenne.access.DataContext.registerNewObject(DataContext.java:5= 36) >=20 > Person is a table in mysql, we aren't map it in xml, we want use it in = fly, we don't define a deEntity for the table, just want use cayenne api = to do the ORM job. >=20 >=20 > and ideas, thanks~