我正在使用hibernate连接到我的数据库以获得项目.
我想要一个查询,使用特定语言的描述和名称从我的数据库中获取产品.我所拥有的参数是该语言的简称,因此首先我必须获取该语言的id,然后获取所需语言的文本.
我尝试了以下hql查询,但没有成功.
from Products as p
where p.productlanguages.languages.shortname like 'eng'
Run Code Online (Sandbox Code Playgroud)
这是数据库中应该来自的部分的图像:

我有一个sql查询所需的结果,但我似乎无法让它在hibernate中工作.但我更喜欢在hql中这样做.
SELECT * FROM products p
INNER JOIN productlanguage pl ON pl.Products_id = p.id
WHERE pl.Languages_id =
(
SELECT id FROM languages
WHERE Shortname = 'eng'
);
Run Code Online (Sandbox Code Playgroud)
谁能告诉我如何构建这个hql查询?谢谢.
你好真棒字体样式图标集在网站上使用本地级别的图标,但我看,但服务器没有出现时.

我正在编写HTTP代理应用程序的Java代码。在该浏览器中,请求未正确发送,因此服务器正在响应
错误的请求您的浏览器发送了此服务器无法理解的请求。请求标头字段缺少':'分隔符。我不明白为什么会发生错误。
我是java的新手,所以可以知道此问题的解决方案。
请求消息:
GET / HTTP/1.1<br>Host: www.google.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive
Run Code Online (Sandbox Code Playgroud)
我的请求中有错误,但我无法确定。
所以任何人都可以帮助我解决我的问题。
我在控制器中有一个需要处理会话的方法.该方法由一个不需要任何用户输入的get方法调用,所以我想在没有Request类的情况下这样做.
目前,我能够设置会话,但我找不到删除它的方法.它看起来像这样:
if ($boolean_storing_condition_value)
session(['some_data'=>'Some Data']);
else
/* What should be the unset function? */
Run Code Online (Sandbox Code Playgroud)
在Laravel 4.2中,它是用Session::forget('some_data');或完成的Session::flush().如何在Laravel 5.3中完成?
我正在尝试使用 htaccess 在我的域的子文件夹中重写对 main.php 的所有请求。我的 .htaccess 中的代码如下:
RewriteEngine on
RewriteBase /public
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . main.php [L]
Run Code Online (Sandbox Code Playgroud)
我确定模块已启用,我已经使用apache2ctl -M命令进行了检查
root@vps847:/etc/apache2/sites-available# apache2ctl -M
Loaded Modules:
core_module (static)
log_config_module (static)
logio_module (static)
mpm_prefork_module (static)
http_module (static)
so_module (static)
alias_module (shared)
auth_basic_module (shared)
authn_file_module (shared)
authz_default_module (shared)
authz_groupfile_module (shared)
authz_host_module (shared)
authz_user_module (shared)
autoindex_module (shared)
cgi_module (shared)
deflate_module (shared)
dir_module (shared)
env_module (shared)
mime_module (shared)
negotiation_module (shared)
php5_module (shared)
reqtimeout_module (shared)
rewrite_module (shared)
setenvif_module (shared)
ssl_module (shared) …Run Code Online (Sandbox Code Playgroud) 我有两个Laravel与透视表连接的表。这两个表是users和roles,数据透视表称为role_user。数据透视表还包含两个额外的字段:start和stop。这样,我可以跟踪a user过去担任过哪些角色。
现在,我想创建一个查询,以获取users当前拥有的所有查询role_id = 3。
首先,我曾使用过WherePivot,但显然被窃听。
我现在使用进行了以下查询Eloquent:
Role::with('User')
->where('id', '=', '3')
->where('role_user.start', '<', date('Y-m-d'))
->where('role_user.stop', '>', date('Y-m-d'))
->whereHas('users', function($q){
$q->where('firstname', 'NOT LIKE', '%test%');
})
->get();
Run Code Online (Sandbox Code Playgroud)
但是不知何故,我收到一个错误,即找不到数据透视表的列开头。但我可以确认PHPMyAdmin那一栏在那里。
这是整个错误:
Illuminate \ Database \ QueryException
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'klj_role_user.start' in 'where clause' (SQL: select * from `klj_roles` where `id` = 3 and `klj_role_user`.`start` < …Run Code Online (Sandbox Code Playgroud) 我在laravel中有一个blade模板laravel,显示一个标签视图.选项卡是不同的eventtypes,在选项卡中是events每种类型.这种观点一直运作到今天.唯一改变的是我可以进行软删除events.
我得到的错误如下:
syntax error, unexpected 'endforeach' (T_ENDFOREACH)
Run Code Online (Sandbox Code Playgroud)
这是模板的完整源代码:
@extends('master')
@section('title', '- Kalenderbeheer')
@section('head')
{{ HTML::script('Script/lib/dataTables.js'); }}
<script>
$(document).ready(function(){
$("#EventTypeTabs").tab();
$(".eventtable").dataTable({
paging: false,
info: false,
"aoColumns": [
null,
null,
null,
{ "asSorting": [] }
]
});
$(".eventtable tr").click(function(){
if ($(this).data("id"))
location.href = "/kalender/admin/" + $(this).data("id");
})
});
</script>
@stop
@section('body')
<div class="row">
<div class="col-md-6 col-md-offset-1">
<h1>Kalenderbeheer</h1>
</div>
<div class="col-md-4 rtl">
<a href="/kalender/admin/nieuw">Nieuwe activiteit toevoegen</a>
</div>
</div>
<div class="row">
<div class="col-md-10 col-md-offset-1"> …Run Code Online (Sandbox Code Playgroud) 我有一个UILabel子视图,UIButton我从另一个视图传递值并填充UILabel.现在,我希望UILabel
必须根据内容更改其高度.如果文本为"Hello",则必须为1行,但如果文本为"我的文本太长而无法放入标签",则必须更改其大小.我用过
[self.addressLabel sizeToFit];
Run Code Online (Sandbox Code Playgroud)
但为此,我需要在UILabel下留下空白空间.我想要的是,当文本强度增加时,UILabel和UIView的大小必须扩展.
我最近刚刚安装了 XAMPP,我对这一切都很陌生。我试图在 phpmyadmin 中打开一个新数据库,但它给我写了这个错误 - #1146 - Table 'phpmyadmin.pma_column_info' doesn't exist.
我在网上查了一下,它说我需要create_tables.sql在数据库“phpmyadmin”上运行一个查询,但是每次我点击那个数据库时,它都会给我错误和以前一样的错误 - #1146 - Table 'phpmyadmin.pma_column_info' doesn't exist。
任何人都可以帮助我吗?
谢谢,丹
<?php
require_once('Stripe/lib/Stripe.php');
Stripe::setApiKey(trim($pkey));
try
{
$customer = Stripe_Customer::create(array(
'email' => $_POST['stripeEmail'],
'source' => $_POST['stripeToken'],
'plan' => trim($plan)
));
}
catch(Exception $e)
{
//header('Location:oops.html');
error_log("unable to sign up customer:" . $_POST['stripeEmail'].
", error:" . $e->getMessage());
}
?>
Run Code Online (Sandbox Code Playgroud)
在这里,我想获取客户 ID,因此我打印 $customer 对象,它提供了条带对象,但我不知道如何从该结果中检索客户 ID。如果有人知道请帮助我。提前致谢
laravel ×3
php ×3
java ×2
mysql ×2
.htaccess ×1
apache ×1
bad-request ×1
blade ×1
css3 ×1
eloquent ×1
font-awesome ×1
foreach ×1
hql ×1
html5 ×1
http-error ×1
icons ×1
ios7.1 ×1
laravel-4 ×1
laravel-5 ×1
laravel-5.3 ×1
localhost ×1
mod-rewrite ×1
objective-c ×1
phpmyadmin ×1
proxy ×1
session ×1
sockets ×1
sql ×1
sql-server ×1
ubuntu-12.04 ×1
uilabel ×1
xampp ×1
xcode5.1 ×1