gpt4 book ai didi

java - 从 JDL 文件添加 jHipster 实体时出错

转载 作者:行者123 更新时间:2023-11-30 06:50:52 24 4
gpt4 key购买 nike

我是新来的。我正在尝试使用 JHaspter 创建一个新的应用程序。

我使用了“yo jhipster”命令来生成应用程序。

我已经使用 JDL studio 来开发我的实体,但是,当我将 JDL 与“yo jhipster:import-jdl model.jdl”一起使用时,我收到错误 - 但错误消息没有提供任何关于什么是的线索导致错误。

我看到的错误消息和 JDL 文件的内容如下。请让我知道如何调试这个。请注意,我对 jhipster 和 StackOverflow 来说都是新手。

JDL 文件::---->>>>>>

entity LocationGeofenceComponent{
id Long,
locationID Long,
geoCoordinate String
}

entity Location {
id Long,
streetAddress String,
postalCode String,
city String,
stateProvince String,
countryID String
}


entity FulfillmentProvider{
id Long,
providerName String
}

entity Region {
id Long,
regionName String
}

entity Country {
id Long,
countryName String
}


entity Department {
departmentName String required
}

entity Device {
id Long,
deviceMACAddress String,
deviceID Long,
deviceKey String,
provisionDate ZonedDateTime,
lastHeartbeat ZonedDateTime,
status String,
model String
}

entity Product {
id Long,
productName String,
productBC String,
productID String,
productWidthMM Integer,
productHeightMM Integer,
productDepthMM Integer,
productNettWeightGrams Double,
productNettVolumeMM3 Double,
productGrossWeightGrams Double,
productGrossVolumeMM3 Double,
productDisplayName String
}

entity ProductPrice {
id Long,
productPriceEffectiveeStart ZonedDateTime,
productPriceEffectiveEnd ZonedDateTime,
productPrice Double,
productDefaultPrice Double
}

entity Offer {
id Long,
offerPriceEffectiveStart ZonedDateTime,
offerPriceEffectiveEnd ZonedDateTime,
offerProductPrice Double
}

entity Brand {
id Long,
brandName String
}

entity User {
id Long,
userName String,
userHandle String,
userFBProfile String
}

entity Employee {
id Long,
firstName String,
lastName String,
email String,
phoneNumber String,
title String,
adminOwnerID Long
}

entity PurchaseOrder {
id Long,
PurchaseOrderProductID Long,
PurchaseOrderProductQty Long
}

entity FulfillmentProviderUserAccount{
id Long,
username String,
otherInfo String,
profileID String
}

entity SocialMediaIdentity{
id Long,
provider String,
pricipal String,
profileName String,
profileInfo Blob
}

entity Bundle{
id Long
}

entity Heartbeat{
id Long,
time ZonedDateTime
}

enum Language {
FRENCH, ENGLISH, SPANISH
}

relationship OneToOne {
Department{location} to Location,
Device{activeLocation} to Location
}

relationship ManyToMany {
FulfillmentProvider to Product,
PurchaseOrder to Product,
PurchaseOrder to Bundle,
PurchaseOrder to Offer,
Region to LocationGeofenceComponent
}

// defining multiple OneToMany relationships with comments
relationship OneToMany {
User{device} to Device,
FulfillmentProvider to FulfillmentProviderUserAccount,
User to FulfillmentProviderUserAccount,
Location to LocationGeofenceComponent,
Department{employee} to Employee,
Device{fulfillmentLocation} to Location,
Device to Heartbeat,
Device to PurchaseOrder,
Country to Region,
User to SocialMediaIdentity,
FulfillmentProvider to SocialMediaIdentity
}

relationship ManyToOne {
Device to User,
Device to Product,
PurchaseOrder to User,
Product to Brand,
Offer to Product,
Bundle to Product,
Offer to Bundle,
Location to Country
}


// defining multiple oneToOne relationships
//relationship OneToOne {
//}

// Set service options to all except few
//service all with serviceImpl except Employee, Job
// Set an angular suffix
angularSuffix * with sxnapp

我看到的错误消息 ----->>>>>>

The jdl is being parsed.
{ name: 'NullPointerException',
message: 'The type, and at least one injected field must be passed.',
prototype:
Error
at new buildException (/Users/anuruddhak2/MyStuff/BackedUp/code/EclipseWS/sxnapp/node_modules/jhipster-core/lib/exceptions/exception_factory.js:43:25)
at new JDLRelationship (/Users/anuruddhak2/MyStuff/BackedUp/code/EclipseWS/sxnapp/node_modules/jhipster-core/lib/core/jdl_relationship.js:16:13)
at fillAssociations (/Users/anuruddhak2/MyStuff/BackedUp/code/EclipseWS/sxnapp/node_modules/jhipster-core/lib/parser/jdl_parser.js:158:31)
at Object.parse [as convertToJDL] (/Users/anuruddhak2/MyStuff/BackedUp/code/EclipseWS/sxnapp/node_modules/jhipster-core/lib/parser/jdl_parser.js:41:3)
at constructor.parseJDL (/Users/anuruddhak2/MyStuff/BackedUp/code/EclipseWS/sxnapp/node_modules/generator-jhipster/generators/import-jdl/index.js:57:41)
at Object.<anonymous> (/Users/anuruddhak2/MyStuff/BackedUp/code/EclipseWS/sxnapp/node_modules/yeoman-generator/lib/base.js:439:23)
at /Users/anuruddhak2/MyStuff/BackedUp/code/EclipseWS/sxnapp/node_modules/run-async/index.js:25:25
at /Users/anuruddhak2/MyStuff/BackedUp/code/EclipseWS/sxnapp/node_modules/run-async/index.js:24:19
at /Users/anuruddhak2/MyStuff/BackedUp/code/EclipseWS/sxnapp/node_modules/yeoman-generator/lib/base.js:440:9
at runCallback (timers.js:651:20) }
Error jhipster:import-jdl ./src/model/Model.jdl

ERROR!
Error while parsing entities from JDL

最佳答案

调整你的人际关系。我不确定您的数据是如何配置的,但类似于下面的内容。文档 https://jhipster.github.io/jdl/提供了更好的解释。

    relationship ManyToOne {
Device{product} to Product{device},
PurchaseOrder{user} to User{purchaseorder},
Product{brand} to Brand{product},
Offer{product} to Product{offer},
Bundle{product} to Product{bundler},
Offer{bundle} to Bundle{offer},
Location{country} to Country{location}
}

不需要提供默认的“ID”列。希望对您有帮助

关于java - 从 JDL 文件添加 jHipster 实体时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42804191/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com