我正在使用JPA 2.0并Spring在我的开发中.我的实体类包含两个@ManyToMany关系.
@Entity("payment")
public class PaymentData implements Serializable
{
private Long pk;
private Collection<PaymentItemData> paymentItem;
/**
* minorPaymentItem
*
*/
private Collection<MinorPayItemData> minorPaymentItem;
@ManyToMany(fetch=FetchType.EAGER)
@JoinTable(name = "payitem_m_assig",
joinColumns =
@JoinColumn(name = "pay_item_id", nullable = false),
inverseJoinColumns =
@JoinColumn(name = "minor_pay_item_id", nullable = false))
public Collection<MinorPayItemData> getMinorPaymentItem()
{
return minorPaymentItem;
}
/**
* @param minorPaymentItem the minorPaymentItem to set
*/
public void setMinorPaymentItem(final Collection<MinorPayItemData> value)
{
this.minorPaymentItem = value;
}
@ManyToMany(fetch=FetchType.EAGER)
@JoinTable(name = "payitem_assigned",
joinColumns …Run Code Online (Sandbox Code Playgroud) 在我的HTML中,我在我的一个模态中有这个:
<a href="#" class="clicker" data-dismiss="modal">Click</a>
Run Code Online (Sandbox Code Playgroud)
如果单击此元素,它会隐藏模态.
但是,我希望能够获得在jQuery中关闭模式的元素,如:
$('#myModal').on('hidden.bs.modal', function(event)
{
var invoker = $(event.relatedTarget);
});
Run Code Online (Sandbox Code Playgroud)
但这不起作用.relatedTarget似乎只对工作show.bs.modal和shown.bs.modal(按文档).
那么如何才能获得导致模态在hidden.bs.modal事件中关闭的元素?
javascript jquery twitter-bootstrap bootstrap-modal twitter-bootstrap-3
我需要一些帮助。我已经按照文档所述配置了数据库迁移插件:
grails.plugin.databasemigration.updateOnStart = true
grails.plugin.databasemigration.updateOnStartFileNames = ['changelog.groovy']
Run Code Online (Sandbox Code Playgroud)
运行“grails run-app”时效果很好。我的数据库已按预期迁移,但是在部署“grails war”工件时如何获得此行为?
我已经在 tomcat 上测试了它,通过手动将工件复制到 tomcat/webapps 文件夹,但在部署过程中,hibernate 抱怨缺少列(应该由数据库迁移插件创建的列)。
有任何想法吗?
谢谢!
我已经按照本教程构建了一个提供websockets连接的 Spring Boot 应用程序,但除了 Spring Boot 本身提供的服务之外,我无法从其他客户端连接到这些 websocket。
本complete教程附带的 GitHub 存储库中的目录包含最终的 Spring Boot 代码。我从这个存储库中获取了index.html和app.js文件,并创建了另一个在 Node.js 服务器上运行的客户端。之后,我将连接字符串替换为指向localhost:8080(运行 Spring Boot 的位置)。然后我运行 Node.js 服务器并尝试使用 websockets,但它不起作用。
通过添加.setAllowedOrigins("*")到StompEndpointRegistry注册表中,第一个问题很容易解决。使用此配置,我设法连接到 websocket,但现在我再也没有从套接字收到消息。
我不知道我错过了什么......有谁知道是什么问题?
提取index.html和app.js(重命名为index.js)文件以及Node.js 服务器可以在此处找到以进行测试。要运行它,只需安装依赖项 ( npm install),然后发出npm start. 服务器将响应http://localhost:3000/。
如何配置Arquillian Suite extesion?
https://github.com/it-crowd/arquillian-suite-extension
我想将它用于单个部署测试,以便不必为我的项目中具有@Test方法的每个类进行部署.
顺便说一下,我正在使用带有arquillian的TESTNG ..
我曾尝试将@DataProvider与TestNG和arquillian一起使用,但是当我使用我创建的类时,我无法弄清楚为什么它不起作用.
如果我将它与String或任何原始数据类型一起使用,我的@Test方法将成功接收DataProvider填充的对象.
@DataProvider(name="test")
public Object[][] createdata1() {
return new Object[] { {"test1"}, {"test2"}, {"test2"} };
}
Run Code Online (Sandbox Code Playgroud)
上面的方法有效,但是
@DataProvider(name="test")
public Object[][] createdata1() {
return new Object[] { {new User("test1")}, {new User("test2")}, {new User("test2")}};
}
Run Code Online (Sandbox Code Playgroud)
才不是.第二种方法只给我空指针.
有任何想法吗?