我正在尝试在我的两个实体之间创建OneToMany关系。一个{"bytes_sent":"0","upstream_cluster":"-","downstream_remote_address":"172.20.2.69:40864","path":"/fota-task/admin/callback/dmserver","authority":"fota-task.ns-fota.svc.cluster.local:8081","protocol":"HTTP/1.1","upstream_service_time":"-","upstream_local_address":"-","duration":"0","downstream_local_address":"172.21.12.228:8081","response_code":"404","user_agent":"Swagger-Codegen/1.0.0/java","response_flags":"NR","start_time":"2019-08-15T03:16:45.487Z","method":"2019-08-15T03:16:45.487Z","request_id":"a31eba86-c6bc-9b12-a2d8-0ae7afd254b4","upstream_host":"-","x_forwarded_for":"-","requested_server_name":"-","bytes_received":"0","istio_policy_status":"-"}
可以是许多downstream_local_address":"172.21.12.228:8081"
的成员。
这些是我的实体:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1) {
SubscriptionManager subManager = (SubscriptionManager) context.getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE);
List<SubscriptionInfo> subscriptionInfoList = subManager.getActiveSubscriptionInfoList();
TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
TelephonyManager mgr = telephonyManager.createForSubscriptionId(subscriptionInfoList.get(0).getSubscriptionId());
int isDataEnabledSIM1 = mgr.isDataEnabled()?1:0;
mgr = telephonyManager.createForSubscriptionId(subscriptionInfoList.get(1).getSubscriptionId());
int isDataEnabledSIM2 = mgr.isDataEnabled()?1:0;
Log.d(TAG, "isDataEnabledSIM1: "+isDataEnabledSIM1 + ", isDataEnabledSIM2="+isDataEnabledSIM2);
}
}
Customer
我没有向Club
表中添加字段,而是创建了一个class Club
{
/**
* @ORM\ManyToOne(targetEntity="Customer", inversedBy="clubs")
*/
private $customer;
表,如下所示:
class Customer
{
/**
* @var Club[]
*
* @ORM\OneToMany(targetEntity="Club", cascade={"persist"}, inversedBy="customer")
* @ORM\JoinTable(name="customer_club",
* joinColumns={@ORM\JoinColumn(name="customer_id", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="club_id", referencedColumnName="id", unique=true)}
* )
*/
private $clubs;
这些关系定义是错误的,因为当我加载Symfony 3.4应用程序时,出现以下错误:
[创建错误]在属性上声明的注释@ORM \ OneToMany AppBundle \ Entity \ Customer :: $ clubs没有名为的属性 “ inversedBy”。可用属性:mappedBy,targetEntity,cascade, fetch,orphanRemoval,indexBy
我做错了什么?